public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Steven Bosscher <s.bosscher@student.tudelft.nl>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: c/8387: [3.3 regression] -finline-limit behavior changed; new inlining flags need doc
Date: Tue, 11 Feb 2003 21:56:00 -0000	[thread overview]
Message-ID: <20030211215600.19496.qmail@sources.redhat.com> (raw)

The following reply was made to PR c/8387; it has been noted by GNATS.

From: Steven Bosscher <s.bosscher@student.tudelft.nl>
To: garloff@suse.de, gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org,
	pfeifer@dbai.tuwien.ac.at, dalej@apple.com, nobody@gcc.gnu.org,
	gcc-prs@gcc.gnu.org
Cc: Josef Zlomek <zlomj9am@artax.karlin.mff.cuni.cz>
Subject: Re: c/8387: [3.3 regression] -finline-limit behavior changed; new
	inlining flags need doc
Date: 11 Feb 2003 22:54:51 +0100

 Op di 11-02-2003, om 21:14 schreef Steven Bosscher:
 > This also happens on -O1 -fpic on i586-pc-linux-gnu.  It disappears when
 > I comment out "flag_crossjumping = 1;" in toplev.c, so this bug probably
 > is somewhere in cleanup_cfg()
 > 
 > Greetz
 > Steven
 > 
 
 Yup, crossjumping or cfgcleanup after crossjumping seems to be the cause
 of this.
 
 For this code for example, the problem is that a whole jump table for
 one of the switch statements is wiped out 
 
 ---- 8< ----
 int *g;
 
 int main (void)
 {
   switch (*g)
     {
     case 0:
       {
         switch (*g)
           {
           case 0: *g = 1; break;
           case 1:
           case 2: *g = 1; break;
           case 3:
           case 4: *g = 1; break;
           }
         break;
       }
     case 1:
       {
         switch (*g)
           {
           case 0: *g = 1; break;
           case 1:
           case 2: *g = 1; break;
           case 3:
           case 4: *g = 1; break;
           }
       }
     }
   return 0;
 }
 ---- 8< ----
 steven# gcc-3.4 -v   
 Reading specs from /opt/experimental/lib/gcc-lib/i586-pc-linux-gnu/3.4/specs
 Configured with: ../gcc-trunk/configure --disable-nls --with-gnu-as --with-gnu-ld --prefix=/opt/experimental --program-suffix=-3.4 --enable-languages=c
 Thread model: posix
 gcc version 3.4 20030211 (experimental)
 steven# gcc-3.4 c7887_PR.c -O -fpic -save-temps
 c7887_PR.o: In function `main':
 c7887_PR.o(.text+0x3b): undefined reference to `.L10'
 collect2: ld returned 1 exit status
 
 Look at a piece of the assembly diff:
 
 
 .L3:					.L3:
 movl	g@GOT(%ecx), %eax		movl	g@GOT(%ecx), %eax
 movl	(%eax), %eax			movl	(%eax), %eax
 cmpl	$4, (%eax)			cmpl	$4, (%eax)
 ja	.L2				ja	.L2
 movl	(%eax), %eax			movl	(%eax), %eax
 leal	.L10@GOTOFF(%ecx), %edx		leal	.L10@GOTOFF(%ecx), %edx
 jmp	.L19			     |	movl	(%edx,%eax,4), %eax
 				     >	addl	%ecx, %eax
 				     >	jmp	*%eax
 				     >	.section	.rodata
 				     >	.align 4
 				     >	.align 4
 				     >	.L10:
 				     >	.long	.L5@GOTOFF
 				     >	.long	.L7@GOTOFF
 				     >	.long	.L7@GOTOFF
 				     >	.long	.L9@GOTOFF
 				     >	.long	.L9@GOTOFF
 				     >	.text
 				     >	.L5:
 				     >	movl	g@GOT(%ecx), %eax
 				     >	movl	(%eax), %eax
 				     >	movl	$1, (%eax)
 				     >	jmp	.L2
 				     >	.L7:
 				     >	movl	g@GOT(%ecx), %eax
 				     >	movl	(%eax), %eax
 				     >	movl	$1, (%eax)
 				     >	jmp	.L2
 				     >	.L9:
 				     >	movl	g@GOT(%ecx), %eax
 				     >	movl	(%eax), %eax
 				     >	movl	$1, (%eax)
 				     >	jmp	.L2
 .L11:					.L11:
 movl	g@GOT(%ecx), %eax		movl	g@GOT(%ecx), %eax
 movl	(%eax), %eax			movl	(%eax), %eax
 cmpl	$4, (%eax)			cmpl	$4, (%eax)
 ja	.L2				ja	.L2
 movl	(%eax), %eax			movl	(%eax), %eax
 leal	.L18@GOTOFF(%ecx), %edx		leal	.L18@GOTOFF(%ecx), %edx
 .L19:				     <
 movl	(%edx,%eax,4), %eax		movl	(%edx,%eax,4), %eax
 
 The label that's missing refers to the jump table, but it's gone...
 
 This is for the first select block with five cases.  The second block
 results in a jumptable to 5 identical labels with crossjumping enabled.
 
 To me this is black magic :-)  Hope it helps somebody to fix this bug.
 
 Greetz
 Steven
 
 


             reply	other threads:[~2003-02-11 21:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-11 21:56 Steven Bosscher [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-03-11  5:01 drow
2003-03-11  2:46 Dale Johannesen
2003-03-11  2:26 Daniel Jacobowitz
2003-02-22 21:24 ebotcazou
2003-02-11 20:16 Steven Bosscher

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=20030211215600.19496.qmail@sources.redhat.com \
    --to=s.bosscher@student.tudelft.nl \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).