public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/32004]  New: [4.3 regression] : gcc.target/i386/pr21291.c
@ 2007-05-19 23:31 hjl at lucon dot org
  2007-05-19 23:34 ` [Bug tree-optimization/32004] " hjl at lucon dot org
                   ` (41 more replies)
  0 siblings, 42 replies; 43+ messages in thread
From: hjl at lucon dot org @ 2007-05-19 23:31 UTC (permalink / raw)
  To: gcc-bugs

This patch

http://gcc.gnu.org/ml/gcc-patches/2007-03/msg00129.html

causes gcc.target/i386/pr21291.c on ia32. Richard, can you take a look? Thanks.


-- 
           Summary: [4.3 regression] : gcc.target/i386/pr21291.c
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl at lucon dot org
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug tree-optimization/32004] [4.3 regression] : gcc.target/i386/pr21291.c
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
@ 2007-05-19 23:34 ` hjl at lucon dot org
  2007-05-20  0:13 ` [Bug middle-end/32004] " pinskia at gcc dot gnu dot org
                   ` (40 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: hjl at lucon dot org @ 2007-05-19 23:34 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 445 bytes --]



------- Comment #1 from hjl at lucon dot org  2007-05-20 00:34 -------
It fails with

[hjl@gnu-27 gcc]$ ./xgcc -B./ /tmp/pr21291.c -S -O -m32
/tmp/pr21291.c: In function âbng_ia32_mult_sub_digitâ:
/tmp/pr21291.c:23: error: can't find a register in class âGENERAL_REGSâ while
reloading âasmâ
/tmp/pr21291.c:23: error: âasmâ operand has impossible constraints
[hjl@gnu-27 gcc]$


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.3 regression] : gcc.target/i386/pr21291.c
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
  2007-05-19 23:34 ` [Bug tree-optimization/32004] " hjl at lucon dot org
@ 2007-05-20  0:13 ` pinskia at gcc dot gnu dot org
  2007-05-20  0:26 ` hjl at lucon dot org
                   ` (39 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-05-20  0:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2007-05-20 01:13 -------
I already looked at it, forwprop is not fully to blame, it is doing the only
thing it knows, it optimizes the values correctly.  This is a pure RA issue as
we now run out of registers as we do asm(); if (a != b) instead of doing c =
a-b; asm(); if (c) which means we need one more register and the RA does not
for some unknown reason spill a and b across the asm.  I don't know if we can
call this a regression really, the register allocator has always been this
dumb.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|tree-optimization           |middle-end
           Keywords|                            |ice-on-valid-code, ra


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.3 regression] : gcc.target/i386/pr21291.c
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
  2007-05-19 23:34 ` [Bug tree-optimization/32004] " hjl at lucon dot org
  2007-05-20  0:13 ` [Bug middle-end/32004] " pinskia at gcc dot gnu dot org
@ 2007-05-20  0:26 ` hjl at lucon dot org
  2007-05-20 10:21 ` rguenth at gcc dot gnu dot org
                   ` (38 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: hjl at lucon dot org @ 2007-05-20  0:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from hjl at lucon dot org  2007-05-20 01:25 -------
The original fix for the testcase, PR 21291, is in tree-outof-ssa.c. The
forwprop
change seems to make the tree-outof-ssa.c fix ineffective.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.3 regression] : gcc.target/i386/pr21291.c
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (2 preceding siblings ...)
  2007-05-20  0:26 ` hjl at lucon dot org
@ 2007-05-20 10:21 ` rguenth at gcc dot gnu dot org
  2007-05-20 10:52 ` rguenth at gcc dot gnu dot org
                   ` (37 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-05-20 10:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2007-05-20 11:20 -------
The out-of-ssa patch was clearly a hack to make this testcase work.  But a real
fix involves ra and reload, none of which is in the list I like to work on ;)
But maybe Micha can try to see if this is related to PR19398 as Uros hints.
See also PR25216 where this testcase fails with -fPIC.  Oh, and it still
passes with -fomit-frame-pointer.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |matz at suse dot de
OtherBugsDependingO|                            |25216
              nThis|                            |
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-05-20 11:20:47
               date|                            |
   Target Milestone|---                         |4.3.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.3 regression] : gcc.target/i386/pr21291.c
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (3 preceding siblings ...)
  2007-05-20 10:21 ` rguenth at gcc dot gnu dot org
@ 2007-05-20 10:52 ` rguenth at gcc dot gnu dot org
  2007-05-20 20:40 ` [Bug tree-optimization/32004] " hjl at lucon dot org
                   ` (36 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-05-20 10:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenth at gcc dot gnu dot org  2007-05-20 11:52 -------
As to comment #2, while we need one more register for the comparison, a and b
are available in the argument frame, so there's no reason to "spill" them, we
just need to reload them into one of the many free registers _after_ the asm().
Instead of leaving us with

(insn 12 15 13 2
/home/richard/src/dataflow-branch/gcc/testsuite/gcc.target/i386/pr21291.c:27
(set (reg:CCZ 17 flags)
        (compare:CCZ (mem/c/i:SI (plus:SI (reg/f:SI 16 argp)
                    (const_int 4 [0x4])) [0 alen+0 S4 A32])
            (mem/c/i:SI (plus:SI (reg/f:SI 6 bp)                    (const_int
20 [0x14])) [0 blen+0 S4 A32]))) 2 {*cmpsi_1_insn} (nil))

which is not matching *cmpsi_1_insn predicates (the above is from greg dump).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug tree-optimization/32004] [4.3 regression] : gcc.target/i386/pr21291.c
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (4 preceding siblings ...)
  2007-05-20 10:52 ` rguenth at gcc dot gnu dot org
@ 2007-05-20 20:40 ` hjl at lucon dot org
  2007-05-20 20:51 ` pinskia at gcc dot gnu dot org
                   ` (35 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: hjl at lucon dot org @ 2007-05-20 20:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from hjl at lucon dot org  2007-05-20 21:40 -------
forwprop changes


<bb 2>:
  alen_4 = alen_2(D) - blen_3(D);
  out_5 = 0;
  __asm__("":"=r" a_9, "=r" b_10, "=mr" blen_11, "=mr" out_12, "=&r"
tmp_13:"mr"
 d_6(D), "0" a_7(D), "1" b_8(D), "2" blen_3(D), "3" 0:"edx", "eax");
  if (alen_4 == 0)
    goto <bb 3> (<L0>);
  else
    goto <bb 4> (<L1>);

to

<bb 2>:
  out_5 = 0;
  __asm__("":"=r" a_9, "=r" b_10, "=mr" blen_11, "=mr" out_12, "=&r"
tmp_13:"mr"
 d_6(D), "0" a_7(D), "1" b_8(D), "2" blen_3(D), "3" 0:"edx", "eax");
  if (alen_2(D) == blen_3(D))
    goto <bb 3> (<L0>);
  else
    goto <bb 4> (<L1>);

If it can use blen_11 instead of blen_3(D), it may compile. If forwprop can't
deal some asm stmts very well, it should skip those asm stmts.


-- 

hjl at lucon dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|middle-end                  |tree-optimization
   Target Milestone|4.3.0                       |---


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug tree-optimization/32004] [4.3 regression] : gcc.target/i386/pr21291.c
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (5 preceding siblings ...)
  2007-05-20 20:40 ` [Bug tree-optimization/32004] " hjl at lucon dot org
@ 2007-05-20 20:51 ` pinskia at gcc dot gnu dot org
  2007-05-20 20:52 ` [Bug middle-end/32004] " pinskia at gcc dot gnu dot org
                   ` (34 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-05-20 20:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2007-05-20 21:50 -------
> If it can use blen_11 instead of blen_3(D), it may compile. If forwprop can't
> deal some asm stmts very well, it should skip those asm stmts.

It cannot use blen_11 instead of blen_3 because the asm will have changed the
value.  forwprop does not even see the asm at all (how would it unless it
looked for all SSAnames that had blen in them which is hard to do in the first
place?).  What forwprop is doing is legal but creates a little extra register
pressure which in turn causes GCC's register allocator to go, I don't know what
the fuck to do because I am a stupid register allocator.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.3 regression] : gcc.target/i386/pr21291.c
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (6 preceding siblings ...)
  2007-05-20 20:51 ` pinskia at gcc dot gnu dot org
@ 2007-05-20 20:52 ` pinskia at gcc dot gnu dot org
  2007-05-21  6:46 ` matz at gcc dot gnu dot org
                   ` (33 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-05-20 20:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pinskia at gcc dot gnu dot org  2007-05-20 21:51 -------
There is almost nothing that can be done on the tree level to fix up this
register allocator issue.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|tree-optimization           |middle-end


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.3 regression] : gcc.target/i386/pr21291.c
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (7 preceding siblings ...)
  2007-05-20 20:52 ` [Bug middle-end/32004] " pinskia at gcc dot gnu dot org
@ 2007-05-21  6:46 ` matz at gcc dot gnu dot org
  2007-05-21  7:34 ` ubizjak at gmail dot com
                   ` (32 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: matz at gcc dot gnu dot org @ 2007-05-21  6:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from matz at gcc dot gnu dot org  2007-05-21 07:45 -------
Richard, the problem isn't the compare or where to store the live values
alen and blen (FYI, the store looks invalid, because reload will not
immediately stop when it sees an invalid asm insn, but instead just patch it
out, but it will leave the operands in a funny state, hence the compare insn
looks incorrect).

The problem is the asm instruction itself, and it's actually
the exact same bug as pr21291 , which was worked around by the outof-ssa
change to coalesce both operand, which doesn't work anymore due to the
change in forwprop.  This could have happened also by some other random
transformation, so forwprop isn't at fault.

To recap, the problem goes like this:

You start with 
  int inout, orig;
  orig = inout;
  asm ("": "+mr" (inout));
  use (orig);

which is transformed very early to use explicit output and match operands
(this in fact is the source of all evil, as far as reloads capabilities
are concerned):

  asm ("": "=mr" (inout) : "0" (inout));

Now SSA form properly assigns a new SSA name for the output operand in the
asm to inout, and some other transformation can now make use of the original
SSA name of inout (in this case it's forwprop), so we have:

  asm ("": "=mr" (inout_2) : "0" (inout_1));
  use (inout_1);

Clearly inout_2 and inout_1 can't be coalesced easily anymore, as they
represent two separate values, so they will get different pseudo registers
during expansion.  Pseudos are okay, as we indeed would accept registers
at all in the constraint.  But still from there everything goes downhill:

Both operands need to match per the constraints, but use different pseudo
registers, so they don't match.  The only solution (for reload) is to register
a reload for these operands.  But reloads can only be satisfied by hardregs,
not by memory, so we need a register for this reload, just because we
are presented with non-matching operands.

So, even though we allow memory for this operand, no memory can be used
for it, because both operand parts don't match.  That together with the
other necessary registers will get us over the total limit of 6 available
registers in the end.

So it's a symptom of reload not being able to use memory for reloads
(secondary reloads don't come into play here), a long standing problem.

Alternatively it's also a symptom of both operands not coming into reload as
matching (in which case the pseudo could go to memory just fine, as the
alternative allows it, and no reload would be necessary).

Extending reload to make use of memory for some reloads, where allowed,
might be nice, but is unrealistic in its gory detail (even the secondary mem
support doesn't really help here).

So I think the only feasible fix or work-around is to present reload
with matching operands, where required.  Strictly it's required only
if the alternative allows registers and memory and both operands are different
pseudo regs, all other cases can be handled by reload equally well.

That might still be done in tree form (what the old outof-ssa hack still tries
but can't really work), or in RTL form shortly before reload.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.3 regression] : gcc.target/i386/pr21291.c
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (8 preceding siblings ...)
  2007-05-21  6:46 ` matz at gcc dot gnu dot org
@ 2007-05-21  7:34 ` ubizjak at gmail dot com
  2007-05-21  7:49 ` bonzini at gnu dot org
                   ` (31 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: ubizjak at gmail dot com @ 2007-05-21  7:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from ubizjak at gmail dot com  2007-05-21 08:33 -------
> Extending reload to make use of memory for some reloads, where allowed,
> might be nice, but is unrealistic in its gory detail (even the secondary mem
> support doesn't really help here).

Should we XFAIL this test?


-- 

ubizjak at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |19398


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.3 regression] : gcc.target/i386/pr21291.c
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (9 preceding siblings ...)
  2007-05-21  7:34 ` ubizjak at gmail dot com
@ 2007-05-21  7:49 ` bonzini at gnu dot org
  2007-05-21  8:03 ` matz at gcc dot gnu dot org
                   ` (30 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: bonzini at gnu dot org @ 2007-05-21  7:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from bonzini at gnu dot org  2007-05-21 08:48 -------
Micha, do you mean transforming (while expanding to RTL)

  asm ("": "=mr" (inout_2) : "0" (inout_1));

to

  inout_2 = inout_1;
  asm ("": "=mr" (inout_2) : "0" (inout_2));

?

That shouldn't be too hard.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.3 regression] : gcc.target/i386/pr21291.c
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (10 preceding siblings ...)
  2007-05-21  7:49 ` bonzini at gnu dot org
@ 2007-05-21  8:03 ` matz at gcc dot gnu dot org
  2007-05-21  8:32 ` bonzini at gnu dot org
                   ` (29 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: matz at gcc dot gnu dot org @ 2007-05-21  8:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from matz at gcc dot gnu dot org  2007-05-21 09:03 -------
Exactly.  If during expansion or at some other time before reload, doesn't
matter that much.  Of course there's a remote possibility that some RTL
passes between expand and reload would do the copy propagation to counter
that transformation.  As inout_2 would have two writes this would require
some data flow analysis in the RTL phase to determine that this copy-prop
is valid.  There's hope that this isn't done, so that nobody would destroy
that work-around again :)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.3 regression] : gcc.target/i386/pr21291.c
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (11 preceding siblings ...)
  2007-05-21  8:03 ` matz at gcc dot gnu dot org
@ 2007-05-21  8:32 ` bonzini at gnu dot org
  2007-05-21  8:35 ` matz at gcc dot gnu dot org
                   ` (28 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: bonzini at gnu dot org @ 2007-05-21  8:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from bonzini at gnu dot org  2007-05-21 09:32 -------
So we'd just be replacing a weak workaround with a stronger (but not
definitive) workaround. :-(


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.3 regression] : gcc.target/i386/pr21291.c
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (12 preceding siblings ...)
  2007-05-21  8:32 ` bonzini at gnu dot org
@ 2007-05-21  8:35 ` matz at gcc dot gnu dot org
  2007-05-21  8:41 ` paolo dot bonzini at lu dot unisi dot ch
                   ` (27 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: matz at gcc dot gnu dot org @ 2007-05-21  8:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from matz at gcc dot gnu dot org  2007-05-21 09:35 -------
Yes.  The place where I would think the work-around to become definitive is
exactly before regclass.  Between it and reload nothing interesting happens
transformation wise.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.3 regression] : gcc.target/i386/pr21291.c
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (13 preceding siblings ...)
  2007-05-21  8:35 ` matz at gcc dot gnu dot org
@ 2007-05-21  8:41 ` paolo dot bonzini at lu dot unisi dot ch
  2007-05-21 14:34 ` [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm' hjl at lucon dot org
                   ` (26 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: paolo dot bonzini at lu dot unisi dot ch @ 2007-05-21  8:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from paolo dot bonzini at lu dot unisi dot ch  2007-05-21 09:41 -------
Subject: Re:  [4.3 regression] : gcc.target/i386/pr21291.c

matz at gcc dot gnu dot org wrote:
> ------- Comment #14 from matz at gcc dot gnu dot org  2007-05-21 09:35 -------
> Yes.  The place where I would think the work-around to become definitive is
> exactly before regclass.  Between it and reload nothing interesting happens
> transformation wise.

I was thinking of the same.  Also, if the patch included adding a 
"cfun->have_asm_statement" flag set during RTL expansion, it would 
probably cost little to do it in an entirely new pass before regclass.

Paolo


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (14 preceding siblings ...)
  2007-05-21  8:41 ` paolo dot bonzini at lu dot unisi dot ch
@ 2007-05-21 14:34 ` hjl at lucon dot org
  2007-06-30  9:14 ` pinskia at gcc dot gnu dot org
                   ` (25 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: hjl at lucon dot org @ 2007-05-21 14:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from hjl at lucon dot org  2007-05-21 15:33 -------
Gcc 4.1/4.2/4.3 will fail and gcc 3.4 has no problem:

---
typedef unsigned long bngdigit;
typedef bngdigit *bng;
typedef unsigned int bngcarry;
typedef unsigned long bngsize;

bngdigit
bng_ia32_mult_sub_digit (bng a, bngsize alen, bng b, bngsize blen, bngdigit d)
{
  bngdigit out, tmp;
  bngcarry carry;
  bngdigit a11;
  int x = blen;

  out = 0;
  asm (""
       : "+r" (a), "+r" (b), "+mr" (blen), "+mr" (out), "=&r" (tmp)
       : "mr" (d)
       : "eax", "edx");
  if (alen == blen)
    {
      a11 = out;
      goto t;
    }

  if (x == 0)
    goto t;

  a11 = 1;
 t:
  return a11;
}
---


-- 

hjl at lucon dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.3 regression] :          |[4.1/4.2/4.3 regression] :
                   |gcc.target/i386/pr21291.c   |can't find a register in
                   |                            |class 'GENERAL_REGS' while
                   |                            |reloading 'asm'


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (15 preceding siblings ...)
  2007-05-21 14:34 ` [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm' hjl at lucon dot org
@ 2007-06-30  9:14 ` pinskia at gcc dot gnu dot org
  2007-07-04  3:21 ` mmitchel at gcc dot gnu dot org
                   ` (24 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-06-30  9:14 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
   Target Milestone|---                         |4.1.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (16 preceding siblings ...)
  2007-06-30  9:14 ` pinskia at gcc dot gnu dot org
@ 2007-07-04  3:21 ` mmitchel at gcc dot gnu dot org
  2007-07-04  7:11 ` bonzini at gnu dot org
                   ` (23 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-07-04  3:21 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (17 preceding siblings ...)
  2007-07-04  3:21 ` mmitchel at gcc dot gnu dot org
@ 2007-07-04  7:11 ` bonzini at gnu dot org
  2007-07-04  7:12 ` bonzini at gnu dot org
                   ` (22 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: bonzini at gnu dot org @ 2007-07-04  7:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from bonzini at gnu dot org  2007-07-04 07:11 -------
I'm working on this, but don't hold your breath (hence not assigning to
myself).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (18 preceding siblings ...)
  2007-07-04  7:11 ` bonzini at gnu dot org
@ 2007-07-04  7:12 ` bonzini at gnu dot org
  2007-07-04  8:16 ` bonzini at gnu dot org
                   ` (21 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: bonzini at gnu dot org @ 2007-07-04  7:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from bonzini at gnu dot org  2007-07-04 07:12 -------
*** Bug 25216 has been marked as a duplicate of this bug. ***


-- 

bonzini at gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ghazi at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (19 preceding siblings ...)
  2007-07-04  7:12 ` bonzini at gnu dot org
@ 2007-07-04  8:16 ` bonzini at gnu dot org
  2007-07-04 13:54 ` bonzini at gnu dot org
                   ` (20 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: bonzini at gnu dot org @ 2007-07-04  8:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from bonzini at gnu dot org  2007-07-04 08:16 -------
Created an attachment (id=13843)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13843&action=view)
patch under testing


QED (Quite Easily Done :-)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (20 preceding siblings ...)
  2007-07-04  8:16 ` bonzini at gnu dot org
@ 2007-07-04 13:54 ` bonzini at gnu dot org
  2007-07-04 21:51 ` kauer at os dot inf dot tu-dresden dot de
                   ` (19 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: bonzini at gnu dot org @ 2007-07-04 13:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from bonzini at gnu dot org  2007-07-04 13:54 -------
The attached patch makes PR30311 resurface; this seems like a minor problem
because that code is dubious, and can be worked around by not doing the
transformation when the modes mismatch.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (21 preceding siblings ...)
  2007-07-04 13:54 ` bonzini at gnu dot org
@ 2007-07-04 21:51 ` kauer at os dot inf dot tu-dresden dot de
  2007-07-05 20:11 ` bonzini at gnu dot org
                   ` (18 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: kauer at os dot inf dot tu-dresden dot de @ 2007-07-04 21:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #21 from kauer at os dot inf dot tu-dresden dot de  2007-07-04 21:50 -------
This simple testcase triggers the bug, too. Unfortunatelly I didnot test the
patch yet.

--
inline void g(int b)
{
  register int reg __asm__ ("eax") = 0;
  asm volatile ("nop" : "+r"(reg), "+r"(b));
}

void f(int a)
{
  a /= 1000;
  g(a);
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (22 preceding siblings ...)
  2007-07-04 21:51 ` kauer at os dot inf dot tu-dresden dot de
@ 2007-07-05 20:11 ` bonzini at gnu dot org
  2007-07-06 12:08 ` bonzini at gnu dot org
                   ` (17 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: bonzini at gnu dot org @ 2007-07-05 20:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #22 from bonzini at gnu dot org  2007-07-05 20:11 -------
The patch does not fix this one, which also works in 3.3 and fails in 4.1.  I'm
not sure it's 100% the same bug.  Still, I committed the patch to fix the
testcase from PR21291.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (23 preceding siblings ...)
  2007-07-05 20:11 ` bonzini at gnu dot org
@ 2007-07-06 12:08 ` bonzini at gnu dot org
  2007-07-06 12:18 ` bonzini at gnu dot org
                   ` (16 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: bonzini at gnu dot org @ 2007-07-06 12:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #23 from bonzini at gnu dot org  2007-07-06 12:08 -------
In particular, this one could be rewritten to

inline void g(int b)
{
  register int reg = 0;
  asm volatile ("nop" : "+a"(reg), "+r"(b));
}

void f(int a)
{
  a /= 1000;
  g(a);
}

but the one in PR21291 could not.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (24 preceding siblings ...)
  2007-07-06 12:08 ` bonzini at gnu dot org
@ 2007-07-06 12:18 ` bonzini at gnu dot org
  2007-07-06 15:10 ` bonzini at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: bonzini at gnu dot org @ 2007-07-06 12:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #24 from bonzini at gnu dot org  2007-07-06 12:18 -------
Also, the testcase from comment #21 is not a regression: if we do the inlining
manually, it fails in 3.3 too.  The failing testcase is:

void f(int a)
{
  register int reg asm ("eax") = 0;
  a /= 1000;
  asm volatile ("nop" : "+r"(reg), "+r"(a));
}

So I'm opening a new PR.


-- 

bonzini at gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2007-05-20 11:20:47         |2007-07-06 12:18:13
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (25 preceding siblings ...)
  2007-07-06 12:18 ` bonzini at gnu dot org
@ 2007-07-06 15:10 ` bonzini at gcc dot gnu dot org
  2007-07-06 15:13 ` bonzini at gnu dot org
                   ` (14 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2007-07-06 15:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #25 from bonzini at gnu dot org  2007-07-06 15:10 -------
Subject: Bug 32004

Author: bonzini
Date: Fri Jul  6 15:10:10 2007
New Revision: 126418

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126418
Log:
2007-07-06  Paolo Bonzini  <bonzini@gnu.org>

        PR middle-end/32004
        * function.c (match_asm_constraints_1, rest_of_match_asm_constraints,
        pass_match_asm_constraints): New.
        * passes.c (init_optimization_passes): Add new pass.
        * stmt.c (expand_asm_operands): Set cfun->has_asm_statement.
        * function.h (struct function): Add has_asm_statement bit.
        (current_function_has_asm_statement): New.
        * tree-pass.h (pass_match_asm_constraints): New.


Modified:
    branches/gcc-4_2-branch/gcc/ChangeLog
    branches/gcc-4_2-branch/gcc/function.c
    branches/gcc-4_2-branch/gcc/function.h
    branches/gcc-4_2-branch/gcc/passes.c
    branches/gcc-4_2-branch/gcc/stmt.c
    branches/gcc-4_2-branch/gcc/testsuite/gcc.target/i386/pr21291.c
    branches/gcc-4_2-branch/gcc/tree-pass.h


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (26 preceding siblings ...)
  2007-07-06 15:10 ` bonzini at gcc dot gnu dot org
@ 2007-07-06 15:13 ` bonzini at gnu dot org
  2007-07-06 15:13 ` bonzini at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: bonzini at gnu dot org @ 2007-07-06 15:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #27 from bonzini at gnu dot org  2007-07-06 15:13 -------
fixed.


-- 

bonzini at gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (27 preceding siblings ...)
  2007-07-06 15:13 ` bonzini at gnu dot org
@ 2007-07-06 15:13 ` bonzini at gcc dot gnu dot org
  2007-07-08 10:29 ` ubizjak at gmail dot com
                   ` (12 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2007-07-06 15:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #26 from bonzini at gnu dot org  2007-07-06 15:13 -------
Subject: Bug 32004

Author: bonzini
Date: Fri Jul  6 15:12:55 2007
New Revision: 126419

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126419
Log:
2007-07-06  Paolo Bonzini  <bonzini@gnu.org>

        PR middle-end/32004
        * function.c (match_asm_constraints_1, rest_of_match_asm_constraints,
        pass_match_asm_constraints): New.
        * passes.c (init_optimization_passes): Add new pass.
        * stmt.c (expand_asm_operands): Set cfun->has_asm_statement.
        * function.h (struct function): Add has_asm_statement bit.
        (current_function_has_asm_statement): New.
        * tree-pass.h (pass_match_asm_constraints): New.


Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/acinclude.m4
    branches/gcc-4_1-branch/gcc/aclocal.m4
    branches/gcc-4_1-branch/gcc/function.c
    branches/gcc-4_1-branch/gcc/function.h
    branches/gcc-4_1-branch/gcc/passes.c
    branches/gcc-4_1-branch/gcc/stmt.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.target/i386/pr21291.c
    branches/gcc-4_1-branch/gcc/tree-pass.h


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (28 preceding siblings ...)
  2007-07-06 15:13 ` bonzini at gcc dot gnu dot org
@ 2007-07-08 10:29 ` ubizjak at gmail dot com
  2007-07-08 10:32 ` ubizjak at gmail dot com
                   ` (11 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: ubizjak at gmail dot com @ 2007-07-08 10:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #28 from ubizjak at gmail dot com  2007-07-08 10:29 -------
This patch breaks gcc.dg/torture/pr20314-1.c and gcc.dg/torture/pr20314-2.c
tests for i386 [1] and x86_64 [2] targets on 4.1 branch:

/home/uros/gcc-svn/branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/torture/pr20314-
1.c: In function 'f3':
/home/uros/gcc-svn/branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/torture/pr20314-
1.c:29: internal compiler error: in update_equiv_regs, at local-alloc.c:1117
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

[1]: http://gcc.gnu.org/ml/gcc-testresults/2007-07/msg00314.html
[2]: http://gcc.gnu.org/ml/gcc-testresults/2007-07/msg00315.html


-- 

ubizjak at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (29 preceding siblings ...)
  2007-07-08 10:29 ` ubizjak at gmail dot com
@ 2007-07-08 10:32 ` ubizjak at gmail dot com
  2007-07-09 15:38 ` bonzini at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: ubizjak at gmail dot com @ 2007-07-08 10:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #29 from ubizjak at gmail dot com  2007-07-08 10:32 -------
(In reply to comment #28)
> This patch breaks gcc.dg/torture/pr20314-1.c and gcc.dg/torture/pr20314-2.c
> tests for i386 [1] and x86_64 [2] targets on 4.1 branch:

Also on 4.2 branch [1].

[1]: http://gcc.gnu.org/ml/gcc-testresults/2007-07/msg00316.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (30 preceding siblings ...)
  2007-07-08 10:32 ` ubizjak at gmail dot com
@ 2007-07-09 15:38 ` bonzini at gcc dot gnu dot org
  2007-07-09 15:38 ` bonzini at gnu dot org
                   ` (9 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2007-07-09 15:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #31 from bonzini at gnu dot org  2007-07-09 15:38 -------
Subject: Bug 32004

Author: bonzini
Date: Mon Jul  9 15:37:56 2007
New Revision: 126488

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126488
Log:
2007-07-09  Paolo Bonzini  <bonzini@gnu.org>

        PR middle-end/32004
        * function.c (rest_of_match_asm_constraints): Pass PROP_REG_INFO.

Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/function.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (32 preceding siblings ...)
  2007-07-09 15:38 ` bonzini at gnu dot org
@ 2007-07-09 15:38 ` bonzini at gcc dot gnu dot org
  2007-07-12  1:11 ` kkojima at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2007-07-09 15:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #30 from bonzini at gnu dot org  2007-07-09 15:37 -------
Subject: Bug 32004

Author: bonzini
Date: Mon Jul  9 15:37:32 2007
New Revision: 126487

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126487
Log:
2007-07-09  Paolo Bonzini  <bonzini@gnu.org>

        PR middle-end/32004
        * function.c (rest_of_match_asm_constraints): Pass PROP_REG_INFO.

Modified:
    branches/gcc-4_2-branch/gcc/ChangeLog
    branches/gcc-4_2-branch/gcc/function.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (31 preceding siblings ...)
  2007-07-09 15:38 ` bonzini at gcc dot gnu dot org
@ 2007-07-09 15:38 ` bonzini at gnu dot org
  2007-07-09 15:38 ` bonzini at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: bonzini at gnu dot org @ 2007-07-09 15:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #32 from bonzini at gnu dot org  2007-07-09 15:38 -------
additional fix committed.


-- 

bonzini at gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (33 preceding siblings ...)
  2007-07-09 15:38 ` bonzini at gcc dot gnu dot org
@ 2007-07-12  1:11 ` kkojima at gcc dot gnu dot org
  2007-07-12 19:01 ` paolo dot bonzini at lu dot unisi dot ch
                   ` (6 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: kkojima at gcc dot gnu dot org @ 2007-07-12  1:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #33 from kkojima at gcc dot gnu dot org  2007-07-12 01:11 -------
It seems that the patch 126418 causes an ICE for gcc.dg/asm-4.c
and the patch 126487 breaks gcc.c-torture/compile/20000804-1.c
on 4.2 for SH.  Both failures happen only with -O0.  It looks
ia64 testresults show similar errors:

http://gcc.gnu.org/ml/gcc-testresults/2007-07/msg00309.html
http://gcc.gnu.org/ml/gcc-testresults/2007-07/msg00446.html

on 4.2.


-- 

kkojima at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kkojima at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (34 preceding siblings ...)
  2007-07-12  1:11 ` kkojima at gcc dot gnu dot org
@ 2007-07-12 19:01 ` paolo dot bonzini at lu dot unisi dot ch
  2007-07-13  9:28 ` bonzini at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: paolo dot bonzini at lu dot unisi dot ch @ 2007-07-12 19:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #34 from paolo dot bonzini at lu dot unisi dot ch  2007-07-12 19:01 -------
Subject: Re:  [4.1/4.2/4.3 regression] : can't find
 a register in class 'GENERAL_REGS' while reloading 'asm'

kkojima at gcc dot gnu dot org wrote:
> ------- Comment #33 from kkojima at gcc dot gnu dot org  2007-07-12 01:11 -------
> It seems that the patch 126418 causes an ICE for gcc.dg/asm-4.c
> and the patch 126487 breaks gcc.c-torture/compile/20000804-1.c
> on 4.2 for SH.  Both failures happen only with -O0.  It looks
> ia64 testresults show similar errors:
> 
> http://gcc.gnu.org/ml/gcc-testresults/2007-07/msg00309.html
> http://gcc.gnu.org/ml/gcc-testresults/2007-07/msg00446.html
> 
> on 4.2.

I'll take a look, and revert the patches on 4.1, tomorrow.

Thanks,

Paolo


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (35 preceding siblings ...)
  2007-07-12 19:01 ` paolo dot bonzini at lu dot unisi dot ch
@ 2007-07-13  9:28 ` bonzini at gcc dot gnu dot org
  2007-07-13  9:57 ` paolo dot bonzini at lu dot unisi dot ch
                   ` (4 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2007-07-13  9:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #35 from bonzini at gnu dot org  2007-07-13 09:28 -------
Subject: Bug 32004

Author: bonzini
Date: Fri Jul 13 09:28:16 2007
New Revision: 126616

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126616
Log:
2007-07-13  Paolo Bonzini  <bonzini@gnu.org>

        Revert these patches:

        2007-07-09  Paolo Bonzini  <bonzini@gnu.org>

        PR middle-end/32004
        * function.c (rest_of_match_asm_constraints): Pass PROP_REG_INFO.

        2007-07-06  Paolo Bonzini  <bonzini@gnu.org>

        PR middle-end/32004
        * function.c (match_asm_constraints_1, rest_of_match_asm_constraints,
        pass_match_asm_constraints): New.
        * passes.c (init_optimization_passes): Add new pass.
        * stmt.c (expand_asm_operands): Set cfun->has_asm_statement.
        * function.h (struct function): Add has_asm_statement bit.
        (current_function_has_asm_statement): New.
        * tree-pass.h (pass_match_asm_constraints): New.


Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/function.c
    branches/gcc-4_1-branch/gcc/function.h
    branches/gcc-4_1-branch/gcc/passes.c
    branches/gcc-4_1-branch/gcc/stmt.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.target/i386/pr21291.c
    branches/gcc-4_1-branch/gcc/tree-pass.h


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (36 preceding siblings ...)
  2007-07-13  9:28 ` bonzini at gcc dot gnu dot org
@ 2007-07-13  9:57 ` paolo dot bonzini at lu dot unisi dot ch
  2007-07-17  3:11 ` rob1weld at aol dot com
                   ` (3 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: paolo dot bonzini at lu dot unisi dot ch @ 2007-07-13  9:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #36 from paolo dot bonzini at lu dot unisi dot ch  2007-07-13 09:57 -------
Subject: Re:  [4.1/4.2/4.3 regression] : can't find
 a register in class 'GENERAL_REGS' while reloading 'asm'

kkojima at gcc dot gnu dot org wrote:
> ------- Comment #33 from kkojima at gcc dot gnu dot org  2007-07-12 01:11 -------
> It seems that the patch 126418 causes an ICE for gcc.dg/asm-4.c
> and the patch 126487 breaks gcc.c-torture/compile/20000804-1.c
> on 4.2 for SH.  Both failures happen only with -O0.  It looks
> ia64 testresults show similar errors:
> 
> http://gcc.gnu.org/ml/gcc-testresults/2007-07/msg00309.html
> http://gcc.gnu.org/ml/gcc-testresults/2007-07/msg00446.html

The former is easy and I have a patch.  I don't understand the latter 
instead, it looks like (on sh at least) reload is not able to make a 
valid address and it might be a latent bug.  Could anybody look at it?

Paolo


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (37 preceding siblings ...)
  2007-07-13  9:57 ` paolo dot bonzini at lu dot unisi dot ch
@ 2007-07-17  3:11 ` rob1weld at aol dot com
  2007-07-17  3:19 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: rob1weld at aol dot com @ 2007-07-17  3:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #37 from rob1weld at aol dot com  2007-07-17 03:10 -------
We might want to test "-mfixed-range=REGISTER-RANGE" while we are checking that
this bug is completely fixed.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (38 preceding siblings ...)
  2007-07-17  3:11 ` rob1weld at aol dot com
@ 2007-07-17  3:19 ` pinskia at gcc dot gnu dot org
  2007-07-18  9:03 ` bonzini at gcc dot gnu dot org
  2007-07-19  3:25 ` mmitchel at gcc dot gnu dot org
  41 siblings, 0 replies; 43+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-07-17  3:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #38 from pinskia at gcc dot gnu dot org  2007-07-17 03:18 -------
(In reply to comment #37)
> We might want to test "-mfixed-range=REGISTER-RANGE" while we are checking that
> this bug is completely fixed.

That option does not exist for x86. 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (39 preceding siblings ...)
  2007-07-17  3:19 ` pinskia at gcc dot gnu dot org
@ 2007-07-18  9:03 ` bonzini at gcc dot gnu dot org
  2007-07-19  3:25 ` mmitchel at gcc dot gnu dot org
  41 siblings, 0 replies; 43+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2007-07-18  9:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #39 from bonzini at gnu dot org  2007-07-18 09:02 -------
Subject: Bug 32004

Author: bonzini
Date: Wed Jul 18 09:02:38 2007
New Revision: 126715

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126715
Log:
2007-07-18  Paolo Bonzini  <bonzini@gnu.org>

        Revert:

        2007-07-09  Paolo Bonzini  <bonzini@gnu.org>

        PR middle-end/32004
        * function.c (rest_of_match_asm_constraints): Pass PROP_REG_INFO.

        2007-07-06  Paolo Bonzini  <bonzini@gnu.org>

        PR middle-end/32004
        * function.c (match_asm_constraints_1, rest_of_match_asm_constraints,
        pass_match_asm_constraints): New.
        * passes.c (init_optimization_passes): Add new pass.
        * stmt.c (expand_asm_operands): Set cfun->has_asm_statement.
        * function.h (struct function): Add has_asm_statement bit.
        (current_function_has_asm_statement): New.
        * tree-pass.h (pass_match_asm_constraints): New.


Modified:
    branches/bonzini-4_2-branch-pr32004-reverted/gcc/ChangeLog
    branches/bonzini-4_2-branch-pr32004-reverted/gcc/function.c
    branches/bonzini-4_2-branch-pr32004-reverted/gcc/function.h
    branches/bonzini-4_2-branch-pr32004-reverted/gcc/passes.c
    branches/bonzini-4_2-branch-pr32004-reverted/gcc/stmt.c
   
branches/bonzini-4_2-branch-pr32004-reverted/gcc/testsuite/gcc.target/i386/pr21291.c
    branches/bonzini-4_2-branch-pr32004-reverted/gcc/tree-pass.h


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm'
  2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
                   ` (40 preceding siblings ...)
  2007-07-18  9:03 ` bonzini at gcc dot gnu dot org
@ 2007-07-19  3:25 ` mmitchel at gcc dot gnu dot org
  41 siblings, 0 replies; 43+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-07-19  3:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #40 from mmitchel at gcc dot gnu dot org  2007-07-19 03:25 -------
Subject: Bug 32004

Author: mmitchel
Date: Thu Jul 19 03:25:32 2007
New Revision: 126740

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126740
Log:
        Revert:

        2007-07-09  Paolo Bonzini  <bonzini@gnu.org>

        PR middle-end/32004
        * function.c (rest_of_match_asm_constraints): Pass PROP_REG_INFO.

        2007-07-06  Paolo Bonzini  <bonzini@gnu.org>

        PR middle-end/32004
        * function.c (match_asm_constraints_1, rest_of_match_asm_constraints,
        pass_match_asm_constraints): New.
        * passes.c (init_optimization_passes): Add new pass.
        * stmt.c (expand_asm_operands): Set cfun->has_asm_statement.
        * function.h (struct function): Add has_asm_statement bit.
        (current_function_has_asm_statement): New.
        * tree-pass.h (pass_match_asm_constraints): New.

Modified:
    branches/gcc-4_2-branch/gcc/ChangeLog
    branches/gcc-4_2-branch/gcc/function.c
    branches/gcc-4_2-branch/gcc/function.h
    branches/gcc-4_2-branch/gcc/passes.c
    branches/gcc-4_2-branch/gcc/stmt.c
    branches/gcc-4_2-branch/gcc/testsuite/gcc.target/i386/pr21291.c
    branches/gcc-4_2-branch/gcc/tree-pass.h


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32004


^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2007-07-19  3:25 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-19 23:31 [Bug tree-optimization/32004] New: [4.3 regression] : gcc.target/i386/pr21291.c hjl at lucon dot org
2007-05-19 23:34 ` [Bug tree-optimization/32004] " hjl at lucon dot org
2007-05-20  0:13 ` [Bug middle-end/32004] " pinskia at gcc dot gnu dot org
2007-05-20  0:26 ` hjl at lucon dot org
2007-05-20 10:21 ` rguenth at gcc dot gnu dot org
2007-05-20 10:52 ` rguenth at gcc dot gnu dot org
2007-05-20 20:40 ` [Bug tree-optimization/32004] " hjl at lucon dot org
2007-05-20 20:51 ` pinskia at gcc dot gnu dot org
2007-05-20 20:52 ` [Bug middle-end/32004] " pinskia at gcc dot gnu dot org
2007-05-21  6:46 ` matz at gcc dot gnu dot org
2007-05-21  7:34 ` ubizjak at gmail dot com
2007-05-21  7:49 ` bonzini at gnu dot org
2007-05-21  8:03 ` matz at gcc dot gnu dot org
2007-05-21  8:32 ` bonzini at gnu dot org
2007-05-21  8:35 ` matz at gcc dot gnu dot org
2007-05-21  8:41 ` paolo dot bonzini at lu dot unisi dot ch
2007-05-21 14:34 ` [Bug middle-end/32004] [4.1/4.2/4.3 regression] : can't find a register in class 'GENERAL_REGS' while reloading 'asm' hjl at lucon dot org
2007-06-30  9:14 ` pinskia at gcc dot gnu dot org
2007-07-04  3:21 ` mmitchel at gcc dot gnu dot org
2007-07-04  7:11 ` bonzini at gnu dot org
2007-07-04  7:12 ` bonzini at gnu dot org
2007-07-04  8:16 ` bonzini at gnu dot org
2007-07-04 13:54 ` bonzini at gnu dot org
2007-07-04 21:51 ` kauer at os dot inf dot tu-dresden dot de
2007-07-05 20:11 ` bonzini at gnu dot org
2007-07-06 12:08 ` bonzini at gnu dot org
2007-07-06 12:18 ` bonzini at gnu dot org
2007-07-06 15:10 ` bonzini at gcc dot gnu dot org
2007-07-06 15:13 ` bonzini at gnu dot org
2007-07-06 15:13 ` bonzini at gcc dot gnu dot org
2007-07-08 10:29 ` ubizjak at gmail dot com
2007-07-08 10:32 ` ubizjak at gmail dot com
2007-07-09 15:38 ` bonzini at gcc dot gnu dot org
2007-07-09 15:38 ` bonzini at gnu dot org
2007-07-09 15:38 ` bonzini at gcc dot gnu dot org
2007-07-12  1:11 ` kkojima at gcc dot gnu dot org
2007-07-12 19:01 ` paolo dot bonzini at lu dot unisi dot ch
2007-07-13  9:28 ` bonzini at gcc dot gnu dot org
2007-07-13  9:57 ` paolo dot bonzini at lu dot unisi dot ch
2007-07-17  3:11 ` rob1weld at aol dot com
2007-07-17  3:19 ` pinskia at gcc dot gnu dot org
2007-07-18  9:03 ` bonzini at gcc dot gnu dot org
2007-07-19  3:25 ` mmitchel at gcc dot gnu dot org

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).