Bug 4823

Summary: [3.3/3.4 regression] gcc reports internal compiler error on legal code
Product: gcc Reporter: rudd
Component: inline-asmAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: bangerth, dhazeghi, gcc-bugs, jh, rodrigc, rudd
Priority: P3 Keywords: error-recovery, ice-on-invalid-code
Version: 3.0.2   
Target Milestone: 3.3.1   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:
Attachments: temp.zip

Description rudd 2001-11-07 09:46:01 UTC
The synopsis adequately describes the problem.

Release:
3.0.2

Environment:
Win95/DJGPP 2.03

How-To-Repeat:
gcc -v temp.i
Comment 1 rudd 2001-11-07 09:46:01 UTC
Fix:
No workaround of which I am aware.
Comment 2 Craig Rodrigues 2001-11-12 20:28:35 UTC
State-Changed-From-To: open->feedback
State-Changed-Why: Your attachment seems to have gotten corrupted.
    Can you resubmit your attachment to me directly?
Comment 3 Craig Rodrigues 2001-11-13 04:28:36 UTC
From: rodrigc@gcc.gnu.org
To: gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org,
  nobody@gcc.gnu.org, rodrigc@gcc.gnu.org, rudd@cyberoptics.com
Cc:  
Subject: Re: other/4823: gcc reports internal compiler error on legal code
Date: 13 Nov 2001 04:28:36 -0000

 Synopsis: gcc reports internal compiler error on legal code
 
 State-Changed-From-To: open->feedback
 State-Changed-By: rodrigc
 State-Changed-When: Mon Nov 12 20:28:35 2001
 State-Changed-Why:
     Your attachment seems to have gotten corrupted.
     Can you resubmit your attachment to me directly?
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=4823&database=gcc

Comment 4 rudd 2001-11-13 09:02:05 UTC
From: Eric Rudd <rudd@cyberoptics.com>
To: rodrigc@gcc.gnu.org
Cc: gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org,
        nobody@gcc.gnu.org
Subject: Re: other/4823: gcc reports internal compiler error on legal code
Date: Tue, 13 Nov 2001 09:02:05 -0600

 This is a multi-part message in MIME format.
 
 --Boundary_(ID_roYwgQxeZGUdPrDoELPPxg)
 Content-type: text/plain; charset=us-ascii
 Content-transfer-encoding: 7bit
 
 rodrigc@gcc.gnu.org wrote:
 
 > Synopsis: gcc reports internal compiler error on legal code
 >
 > State-Changed-From-To: open->feedback
 > State-Changed-By: rodrigc
 > State-Changed-When: Mon Nov 12 20:28:35 2001
 > State-Changed-Why:
 >     Your attachment seems to have gotten corrupted.
 >     Can you resubmit your attachment to me directly?
 
 Here it is.   -Eric
 
 --Boundary_(ID_roYwgQxeZGUdPrDoELPPxg)
 Content-type: application/x-zip-compressed; name="temp.ZIP"
 Content-disposition: inline; filename="temp.ZIP"
 Content-transfer-encoding: base64
 
 UEsDBBQAAAAIAPROZytjefq7UAEAAOUCAAAGAAAAdGVtcC5jfVLLasMwELwb/A+LIcUKJrH7
 hIacSq899daUIkdya5AloUeaUPLv1aNWWpJGF+3Ozo6k1ZidpIR2oI2yawNfeQYAPTfANR7k
 Ag5rPoUnO7RUgXB0V2RUw3QeGoiwLaMwlUyY3SLP9vD4/OD2PNMGm37tFFnP6ciz/FNhWf5k
 mL8zWo01RTv0c42EaMvMIkBYD7ARzGm6QhkgtwqATpsYTybalJcIVnxlij8E2yrpCXUFkwaO
 CYzI/td7jwmYkHiEV6hPELbrj0ho/lGQig7NuSO0kecV3B0knHzFvSMsL0wBZRwYSqh1jVCG
 MaMqidUB9eNORDe6ogpFP8QGuaSI4xyjKxclBQ9cp9JNim5TdIfi3VD8PUWNVfzwoXvvkDzb
 iJ5AK4ZWv7WYsF3ZMYFNdNO28lbyLVJwTUdrjPksOO6lfoXl6KrQ5ZAK6hmKh3wDUEsDBBQA
 AAAIAEJHbSs3wISJgwEAAGMDAAAGAAAAdGVtcC5plZLbbuMgEIbvI/kdRlRZmcrrYw9SVrla
 7Rvs3XZVYYMTIowR4Gyjqu++YGI3bdNI5YZ/hm/+wXiuoABkWaf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
 EmWd4kkv+LML4SQMwxNwyK0owHluvYMCLcavODfE+fw+p2muiIrXz6zL+oWX9w7zGZqqFHT2
 dGlJ1sJfecvi4viUM2PRWC3QOUy7FgP7v5bogaV1ZTbc4dME2FPLmT5C7vem0eb8nNGqo8M/
 hK6MLEnN5gDvMMneUU4MMwVZrYRvzv6t1c5y81f8fDzsNwyPVvESuqIW0FptQSrASvrE7bhJ
 pHLqHLgHizmjsYn/KPvT5UUvWJXY2Hf1hsjA6bayhE2dE9No6897QfNXwZseOl1bgSAz4IZQ
 YyX3SKLXiHDzeD+PC+9NHEW73S7MVR1qm0dOZ37HLTajiqi+CwtflZ8ha6U6b+vWpKMyPwBQ
 SwECGQAUAAAACAD0TmcrY3n6u1ABAADlAgAABgAAAAAAAAABACAAAAAAAAAAdGVtcC5jUEsB
 AhkAFAAAAAgAQkdtKzfAhImDAQAAYwMAAAYAAAAAAAAAAQAgAAAAdAEAAHRlbXAuaVBLAQIZ
 ABQAAAAIAEJHbSt3Op0QpgIAAGIFAAAIAAAAAAAAAAEAIAAAABsDAAB0ZW1wLmxvZ1BLBQYA
 AAAAAwADAJ4AAADnBQAAAAA=
 
 --Boundary_(ID_roYwgQxeZGUdPrDoELPPxg)--
Comment 5 Craig Rodrigues 2001-11-13 19:13:28 UTC
State-Changed-From-To: feedback->analyzed
State-Changed-Why: Preprocessed source provided.
    
    Under gcc 3.0.2, reproduced the ICE.
    
    Under gcc 3.1, no ICE, but the following warning:
    temp.c: In function `bombs_badly':
    temp.c:8: Output constraint 0 cannot be specified together with "st" clobber
    temp.c:29: confused by earlier errors, bailing out
Comment 6 Craig Rodrigues 2001-11-14 03:13:28 UTC
From: rodrigc@gcc.gnu.org
To: gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org,
  nobody@gcc.gnu.org, rodrigc@gcc.gnu.org, rudd@cyberoptics.com
Cc:  
Subject: Re: other/4823: gcc reports internal compiler error on legal code
Date: 14 Nov 2001 03:13:28 -0000

 Synopsis: gcc reports internal compiler error on legal code
 
 State-Changed-From-To: feedback->analyzed
 State-Changed-By: rodrigc
 State-Changed-When: Tue Nov 13 19:13:28 2001
 State-Changed-Why:
     Preprocessed source provided.
     
     Under gcc 3.0.2, reproduced the ICE.
     
     Under gcc 3.1, no ICE, but the following warning:
     temp.c: In function `bombs_badly':
     temp.c:8: Output constraint 0 cannot be specified together with "st" clobber
     temp.c:29: confused by earlier errors, bailing out
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=4823&database=gcc

Comment 7 Wolfgang Bangerth 2003-01-07 19:33:19 UTC
From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: gcc-bugs@gcc.gnu.org, <gcc-gnats@gcc.gnu.org>
Cc:  
Subject: Re: inline-asm/4823: gcc reports internal compiler error on legal
 code
Date: Tue, 7 Jan 2003 19:33:19 -0600 (CST)

 This is also visible on x86-linux. A short testcase is this:
 ---------------------------------
 void f() {
    double result;
    asm volatile (
       "  faddp    %0, %1  \n\t"
    :  "=&t" (result)
    :  "u"   (result),
       "0"   (result)
    :  "%st",    "%st(1)", "%st(2)", "%st(3)",
       "%st(4)", "%st(5)", "%st(6)", "%st(7)"
    );
 }
 -------------------------
 
 It crashes like so:
 tmp/g> /home/bangerth/bin/gcc-3.4-pre/bin/gcc temp.c
 temp.c: In function `f':
 temp.c:3: error: output constraint 0 cannot be specified together with 
 "st" clobber
 temp.c:11: internal compiler error: in convert_regs_1, at reg-stack.c:2740
 
 
 The crash is in fact a regression since it worked in gcc2.95. gcc3.0.4 
 issued this, differing, message:
 
 tmp/g> /home/bangerth/bin/gcc-3.0.4/bin/gcc temp.c
 temp.c: In function `f':
 temp.c:11: Internal compiler error in emit_swap_insn, at reg-stack.c:951
 
 
 gcc3.2 crashes (with the internal error replaced with "bailing out"), as 
 well as 3.3 and 3.4.
 
 W.
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth             email:            bangerth@ticam.utexas.edu
                               www: http://www.ticam.utexas.edu/~bangerth/
 
 

Comment 8 s.bosscher 2003-03-24 20:41:28 UTC
From: Steven Bosscher <s.bosscher@student.tudelft.nl>
To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org,
	rudd@cyberoptics.com, gcc-prs@gcc.gnu.org, rodrigc@gcc.gnu.org,
	jh@suse.cz
Cc:  
Subject: Re: inline-asm/4823: [3.2/3.3/3.4 regression] gcc reports internal
 compiler error on legal code
Date: Mon, 24 Mar 2003 20:41:28 +0100

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4823
 
 For Wolfgang's smaller testcase:
 
 ---------------------------------
 void
 f (void)
 {
   double result;
   asm volatile (
   " faddp %0, %1 \n\t"
   : "=&t" (result)
   : "u" (result),
     "0" (result)
   : "%st", "%st(1)", "%st(2)", "%st(3)",
     "%st(4)", "%st(5)", "%st(6)", "%st(7)"
   );
 }
 ------------------------
 
 we now don't crash.  Instead we bail out with an error.
 
 # gcc-3.3 -c 4823.c
 4823.c: In function `f':
 4823.c:5: error: output constraint 0 cannot be specified together with 
 "st" clobber
 4823.c:8: confused by earlier errors, bailing out
 # gcc-3.3 -c 4823.c -O
 4823.c: In function `f':
 4823.c:5: error: output constraint 0 cannot be specified together with 
 "st" clobber
 4823.c:8: confused by earlier errors, bailing out
 # gcc-3.3 -c 4823.c -O2
 4823.c: In function `f':
 4823.c:5: error: output constraint 0 cannot be specified together with 
 "st" clobber
 4823.c:8: confused by earlier errors, bailing out
 
 Honza, is this the correct behavior?
 
 Greetz
 Steven
 
 

Comment 9 Jan Hubicka 2003-03-24 23:38:02 UTC
From: Jan Hubicka <jh@suse.cz>
To: Steven Bosscher <s.bosscher@student.tudelft.nl>
Cc: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org,
	rudd@cyberoptics.com, gcc-prs@gcc.gnu.org, rodrigc@gcc.gnu.org,
	jh@suse.cz
Subject: Re: inline-asm/4823: [3.2/3.3/3.4 regression] gcc reports internal compiler error on legal code
Date: Mon, 24 Mar 2003 23:38:02 +0100

 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4823
 > 
 > For Wolfgang's smaller testcase:
 > 
 > ---------------------------------
 > void
 > f (void)
 > {
 >  double result;
 >  asm volatile (
 >  " faddp %0, %1 \n\t"
 >  : "=&t" (result)
 >  : "u" (result),
 >    "0" (result)
 >  : "%st", "%st(1)", "%st(2)", "%st(3)",
 >    "%st(4)", "%st(5)", "%st(6)", "%st(7)"
 >  );
 > }
 > ------------------------
 > 
 > we now don't crash.  Instead we bail out with an error.
 > 
 > # gcc-3.3 -c 4823.c
 > 4823.c: In function `f':
 > 4823.c:5: error: output constraint 0 cannot be specified together with 
 > "st" clobber
 > 4823.c:8: confused by earlier errors, bailing out
 > # gcc-3.3 -c 4823.c -O
 > 4823.c: In function `f':
 > 4823.c:5: error: output constraint 0 cannot be specified together with 
 > "st" clobber
 > 4823.c:8: confused by earlier errors, bailing out
 > # gcc-3.3 -c 4823.c -O2
 > 4823.c: In function `f':
 > 4823.c:5: error: output constraint 0 cannot be specified together with 
 > "st" clobber
 > 4823.c:8: confused by earlier errors, bailing out
 > 
 > Honza, is this the correct behavior?
 Hmm, not really "confused by earlier errors, bailing out" means that
 compiler segfaulted.  It is different failure - the reg-stack is not
 really good at dealing with missformed asm constrains.  I believe I've
 sent a patch some time ago for similar problem, will try to dig it out,
 but probably next week - this week is bit too hectic for me.
 
 Honza
 > 
 > Greetz
 > Steven
 > 

Comment 10 Dara Hazeghi 2003-05-10 14:19:05 UTC
From: Dara Hazeghi <dhazeghi@yahoo.com>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: inline-asm/4823: [3.3/3.4 regression] gcc reports internal compiler error on legal code
Date: Sat, 10 May 2003 14:19:05 -0700

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit- 
 trail&database=gcc&pr=4823
 
 Confirmed with 3.2.3, 3.3 branch and mainline (20030509).
 
 Dara
Comment 11 Richard Henderson 2003-06-12 18:04:57 UTC
http://gcc.gnu.org/ml/gcc-patches/2003-06/msg01290.html