Bug 10402 - [3.3/3.4 regression] [x86] ICE in merge_assigned_reloads, at reload1.c:6134
Summary: [3.3/3.4 regression] [x86] ICE in merge_assigned_reloads, at reload1.c:6134
Alias: None
Product: gcc
Classification: Unclassified
Component: inline-asm (show other bugs)
Version: 3.4.0
: P3 normal
Target Milestone: 3.3.1
Assignee: Not yet assigned to anyone
Keywords: ice-on-invalid-code
Depends on:
Reported: 2003-04-14 16:56 UTC by Robert Schiele
Modified: 2004-01-17 04:22 UTC (History)
3 users (show)

See Also:
Host: i486-suse-linux-gnu
Target: i486-suse-linux-gnu
Build: i486-suse-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2003-06-07 16:50:52


Note You need to log in before you can comment on or make changes to this bug.
Description Robert Schiele 2003-04-14 16:56:00 UTC
When compiling the following code with optimization turned on, I get an ICE in merge_assigned_reloads, at reload1.c:6134:

void a()
    struct { long b; } *c, *d, *e;
    c = e;
    int f;
    asm volatile("" :"=S" (f), "=D" (f) :);
    asm("" : "=m" (c->b), "=b" (c) : "m" (d->b), "a" (c), "d" (d), "b" (c));

I am not absolutely sure, whether this code is legal, but I can't see why it should not.

3.3 20030413 (prerelease), 3.4 20030413 (experimental)

System: Linux schiele 2.4.20-4GB-athlon #1 Mon Mar 17 17:56:47 UTC 2003 i686 unknown unknown GNU/Linux
Architecture: i686
host: i486-suse-linux-gnu
build: i486-suse-linux-gnu
target: i486-suse-linux-gnu
configured with: /local/src/gcc/configure --enable-threads=posix --prefix=/local/inst/gcc34 --enable-languages=c,c++,f77,objc --disable-checking --disable-libgcj --with-gxx-include-dir=/local/inst/gcc34/include/g++ --with-system-zlib --enable-shared --enable-__cxa_atexit i486-suse-linux

gcc -O -c ice.i
Comment 1 Wolfgang Bangerth 2003-04-14 18:18:54 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed. A regression w.r.t 3.2
Comment 2 Richard Henderson 2003-04-18 03:45:12 UTC
State-Changed-From-To: analyzed->suspended
State-Changed-Why: The code is illegal.  The same variable can't be the target
    of two outputs.
Comment 3 Richard Henderson 2003-04-18 03:45:53 UTC
State-Changed-From-To: suspended->analyzed
State-Changed-Why: analyzed->analyzed
Comment 4 Robert Schiele 2003-04-18 08:05:13 UTC
From: Robert Schiele <rschiele@uni-mannheim.de>
To: rth@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
   nobody@gcc.gnu.org, shensche@kodeaffe.de, gcc-gnats@gcc.gnu.org
Subject: Re: inline-asm/10402: [3.3/3.4 regression] [i486] ICE in merge_assigned_reloads, at reload1.c:6134
Date: Fri, 18 Apr 2003 08:05:13 +0200

 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 On Fri, Apr 18, 2003 at 03:45:12AM -0000, rth@gcc.gnu.org wrote:
 >     The code is illegal.  The same variable can't be the target
 >     of two outputs. =20
 You mean because of the variable 'f'?
 Doesn't make a difference whether the second output is a different one. Cha=
 this line and the one above to:
 int f, g;
 asm volatile("" :"=3DS" (f), "=3DD" (g) :);
 The same thing happens.
 So we have an ice-on-legal-and-illegal-code.  ;-)
 Robert Schiele			Tel.: +49-621-181-2517
 Dipl.-Wirtsch.informatiker	mailto:rschiele@uni-mannheim.de
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)
Comment 5 Andrew Pinski 2003-06-07 16:50:52 UTC
still happens on the mainline (20030607).
Comment 6 Richard Henderson 2003-06-12 18:22:24 UTC
I don't see it with mainline or 3.3 on 2003-06-12.
Comment 7 Robert Schiele 2003-06-12 18:33:22 UTC
You are right, it does no longer happen. Seems someone has fixed it by accident. ;-)