Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Guy Martin <gmsoft@tuxicoman.be>
To: linux-parisc@vger.kernel.org
Subject: GCC 4.5 regression
Date: Thu, 17 Feb 2011 20:15:23 +0100	[thread overview]
Message-ID: <20110217201523.2da3b41a@zombie> (raw)

[-- Attachment #1: Type: text/plain, Size: 3132 bytes --]


Hi all,


I've spotted this regression while testing gcc 4.5.2.
It hangs while doing one of the configure test of diffutils.

I've attached a reduced test case. The program is supposed to
segfault because of a stack overflow. However, with 4.5, it just hangs.
It seems that 4.5 simply over-optimize the function and replaces it
with a single jump.

Should I open a PR ?
Do you need other info ?

Here is how gcc is configured :

terminator test # gcc-4.4.5 -v
Using built-in specs.
Target: hppa2.0-unknown-linux-gnu
Configured
with: /var/tmp/portage/sys-devel/gcc-4.4.5/work/gcc-4.4.5/configure
--prefix=/usr --bindir=/usr/hppa2.0-unknown-linux-gnu/gcc-bin/4.4.5
--includedir=/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.4.5/include
--datadir=/usr/share/gcc-data/hppa2.0-unknown-linux-gnu/4.4.5
--mandir=/usr/share/gcc-data/hppa2.0-unknown-linux-gnu/4.4.5/man
--infodir=/usr/share/gcc-data/hppa2.0-unknown-linux-gnu/4.4.5/info
--with-gxx-include-dir=/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.4.5/include/g++-v4
--host=hppa2.0-unknown-linux-gnu --build=hppa2.0-unknown-linux-gnu
--disable-altivec --disable-fixed-point --without-ppl --without-cloog
--enable-nls --without-included-gettext --with-system-zlib
--disable-werror --enable-secureplt --disable-multilib
--enable-libmudflap --disable-libssp --enable-libgomp --enable-cld
--with-python-dir=/share/gcc-data/hppa2.0-unknown-linux-gnu/4.4.5/python
--enable-checking=release --disable-libgcj
--enable-languages=c,c++,fortran --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu
--with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.4.5
p1.2, pie-0.4.5' Thread model: posix gcc version 4.4.5 (Gentoo 4.4.5
p1.2, pie-0.4.5) 


terminator test # gcc-4.5.2 -v
Using built-in specs.
COLLECT_GCC=gcc-4.5.2
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/hppa2.0-unknown-linux-gnu/4.5.2/lto-wrapper
Target: hppa2.0-unknown-linux-gnu
Configured
with: /var/tmp/portage/sys-devel/gcc-4.5.2/work/gcc-4.5.2/configure
--prefix=/usr --bindir=/usr/hppa2.0-unknown-linux-gnu/gcc-bin/4.5.2
--includedir=/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.5.2/include
--datadir=/usr/share/gcc-data/hppa2.0-unknown-linux-gnu/4.5.2
--mandir=/usr/share/gcc-data/hppa2.0-unknown-linux-gnu/4.5.2/man
--infodir=/usr/share/gcc-data/hppa2.0-unknown-linux-gnu/4.5.2/info
--with-gxx-include-dir=/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.5.2/include/g++-v4
--host=hppa2.0-unknown-linux-gnu --build=hppa2.0-unknown-linux-gnu
--disable-altivec --disable-fixed-point --without-ppl --without-cloog
--disable-lto --enable-nls --without-included-gettext
--with-system-zlib --disable-werror --enable-secureplt
--disable-multilib --enable-libmudflap --disable-libssp
--enable-libgomp --enable-cld
--with-python-dir=/share/gcc-data/hppa2.0-unknown-linux-gnu/4.5.2/python
--enable-checking=release --disable-libgcj
--enable-languages=c,c++,fortran --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu
--with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.5.2
p1.0, pie-0.4.5' Thread model: posix gcc version 4.5.2 (Gentoo 4.5.2
p1.0, pie-0.4.5) 




Cheers,
  Guy

[-- Attachment #2: conftest.c --]
[-- Type: text/x-c++src, Size: 164 bytes --]

#include <unistd.h>

static int recurse (char *a)
 {
   char tmp[500];
   *tmp = *a + 1;
   return recurse(tmp);
 }

int main (void) {
   return recurse ("\1");
}


[-- Attachment #3: conftest-4.5.s --]
[-- Type: application/octet-stream, Size: 471 bytes --]

	.LEVEL 1.1
	.text
	.align 4
	.type	recurse.clone.0, @function
recurse.clone.0:
	.PROC
	.CALLINFO FRAME=0,NO_CALLS
	.ENTRY
.L2:
	b,n .L2
	.EXIT
	.PROCEND
	.size	recurse.clone.0, .-recurse.clone.0
	.align 4
.globl main
	.type	main, @function
main:
	.PROC
	.CALLINFO FRAME=0,NO_CALLS,SAVE_RP
	.ENTRY
	stw %r2,-20(%r30)
	ldi 1,%r26
	ldw -20(%r30),%r2
	bl recurse.clone.0,%r0
	nop
	nop
	.EXIT
	.PROCEND
	.size	main, .-main
	.ident	"GCC: (Gentoo 4.5.2 p1.0, pie-0.4.5) 4.5.2"

[-- Attachment #4: conftest-4.4.s --]
[-- Type: application/octet-stream, Size: 725 bytes --]

	.LEVEL 1.1
	.text
	.align 4
	.type	recurse, @function
recurse:
	.PROC
	.CALLINFO FRAME=576,CALLS,SAVE_RP
	.ENTRY
	stw %r2,-20(%r30)
	ldb 0(%r26),%r28
	ldo 1(%r28),%r28
	ldo 576(%r30),%r30
	stb %r28,-568(%r30)
	bl recurse,%r2
	ldo -568(%r30),%r26
	ldw -596(%r30),%r2
	bv %r0(%r2)
	ldo -576(%r30),%r30
	.EXIT
	.PROCEND
	.size	recurse, .-recurse
	.section	.rodata.str1.4,"aMS",@progbits,1
	.align 4
.LC0:
	.stringz	"\001"
	.text
	.align 4
.globl main
	.type	main, @function
main:
	.PROC
	.CALLINFO FRAME=0,NO_CALLS,SAVE_RP
	.ENTRY
	stw %r2,-20(%r30)
	ldil LR'.LC0,%r26
	ldw -20(%r30),%r2
	ldo RR'.LC0(%r26),%r26
	bl recurse,%r0
	nop
	nop
	.EXIT
	.PROCEND
	.size	main, .-main
	.ident	"GCC: (Gentoo 4.4.5 p1.2, pie-0.4.5) 4.4.5"

             reply	other threads:[~2011-02-17 19:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-17 19:15 Guy Martin [this message]
2011-02-17 19:48 ` GCC 4.5 regression John David Anglin
2011-02-18  1:28 ` Matt Turner
2011-02-18  5:37   ` Mike Frysinger
2011-02-18 15:17     ` Guy Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110217201523.2da3b41a@zombie \
    --to=gmsoft@tuxicoman.be \
    --cc=linux-parisc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox