public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/24609]  New: Same value duplicated in two different registers
@ 2005-11-01  5:33 ian at airs dot com
  2005-11-01  6:02 ` [Bug tree-optimization/24609] " ian at airs dot com
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: ian at airs dot com @ 2005-11-01  5:33 UTC (permalink / raw)
  To: gcc-bugs

This test case causes the same value to be consistently stored in two different
registers.  This happens when compiling at -O2.

extern int abs (int __x);
extern int bar (short*, short, int);

struct s
{
  short int* top;
  short int* left;
  short int* diag;
};

int
foo (int *a, struct s* p, short int pv[6][16])
{
  int s = 0;
  int b;

  for (b = 0; b < 6; ++b)
    {
      int d;
      short int ps;

      if (abs (p->left[0] - p->diag[0])
          < abs (p->diag[0] - p->top[0]))
        d = 1;
      else
        d = 2;
      a[b] = d;

      ps = ((char*) p)[d - 1];

      s += bar (pv[b], ps, a[b]);
    }

  return s;
}

In the .s file generated by gcc -S -O2 foo.c, I see this:

.L12:
        movl    $1, %eax
        movl    $1, %edx
.L5:

and, later, this:
        jl      .L12
        movl    $2, %eax
        movl    $2, %edx
        jmp     .L5

These are the only ways to reach the label L5.  In other words, when we reach
.L5, %eax and %edx always have the same value.  Both registers are used one or
two times, and are then set to something else.  The duplication is useless, and
effectively wastes a register which could in principle be used to hold a more
useful value.  Setting two values in this way also makes the relatively simple
condition setting d too complicated for RTL if-conversion. 

The initial duplication appears to happen in PRE, which appears to feel that
(int) d and (unsigned int) d should be treated differently and introduces a
variable to hold (unsigned int) d.  After this duplication, nothing ever seems
to clean it up.


-- 
           Summary: Same value duplicated in two different registers
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ian at airs dot com


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


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

* [Bug tree-optimization/24609] Same value duplicated in two different registers
  2005-11-01  5:33 [Bug tree-optimization/24609] New: Same value duplicated in two different registers ian at airs dot com
@ 2005-11-01  6:02 ` ian at airs dot com
  2005-11-01 14:54 ` pinskia at gcc dot gnu dot org
                   ` (18 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: ian at airs dot com @ 2005-11-01  6:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from ian at airs dot com  2005-11-01 06:02 -------
Created an attachment (id=10095)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10095&action=view)
.s file from gcc -S -O2

For reference, here is the complete .s file I get from gcc -S -O2.


-- 


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


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

* [Bug tree-optimization/24609] Same value duplicated in two different registers
  2005-11-01  5:33 [Bug tree-optimization/24609] New: Same value duplicated in two different registers ian at airs dot com
  2005-11-01  6:02 ` [Bug tree-optimization/24609] " ian at airs dot com
@ 2005-11-01 14:54 ` pinskia at gcc dot gnu dot org
  2005-11-01 16:09 ` ian at airs dot com
                   ` (17 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-01 14:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2005-11-01 14:54 -------
Actually it is "int*" and "int" and that mainly comes down to how we repesent
(int*)[d];
If we change the code (we should be able to do this in the IR also, Daniel
Berlin had a patch which did it):
extern int abs (int __x);
extern int bar (short*, short, int);

struct s
{
  short int* top;
  short int* left;
  short int* diag;
};
typedef int aar[];
typedef aar *aptr;
typedef char par[];
typedef par *pptr;

int
foo (int *a, struct s* p, short int pv[6][16])
{
  int s = 0;
  int b;
  aptr a1;
  a1 = (aptr)(a);
  pptr p1= (pptr)(p);


  for (b = 0; b < 6; ++b)
    {
      int d;
      short int ps;

      if (abs (p->left[0] - p->diag[0])
          < abs (p->diag[0] - p->top[0]))
        d = 1;
      else
        d = 2;
      (*a1)[b] = d;

      ps = (*p1)[d - 1];

      s += bar (pv[b], ps, a[b]);
    }

  return s;
}
--

We get:
.L12:
        movl    $1, %eax
        xorl    %edx, %edx
.....
        jl      .L12
        movl    $2, %eax
        movl    $1, %edx
        jmp     .L5


-- 


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


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

* [Bug tree-optimization/24609] Same value duplicated in two different registers
  2005-11-01  5:33 [Bug tree-optimization/24609] New: Same value duplicated in two different registers ian at airs dot com
  2005-11-01  6:02 ` [Bug tree-optimization/24609] " ian at airs dot com
  2005-11-01 14:54 ` pinskia at gcc dot gnu dot org
@ 2005-11-01 16:09 ` ian at airs dot com
  2005-11-01 16:17 ` pinskia at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: ian at airs dot com @ 2005-11-01 16:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from ian at airs dot com  2005-11-01 16:09 -------
You've managed to change the code so that we still have two registers, but now
they have different values.  I agree that there are probably going to be times
when it is good to have two different registers.  But when they always have the
same value, as they do in my original test case, shouldn't something clean that
up?  If so, what?

And do you still get two registers in your test case if you change (*p1)[d - 1]
to (*p1)[d]?  And if you do get two registers, do they have the same value or
not?


-- 


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


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

* [Bug tree-optimization/24609] Same value duplicated in two different registers
  2005-11-01  5:33 [Bug tree-optimization/24609] New: Same value duplicated in two different registers ian at airs dot com
                   ` (2 preceding siblings ...)
  2005-11-01 16:09 ` ian at airs dot com
@ 2005-11-01 16:17 ` pinskia at gcc dot gnu dot org
  2005-11-01 18:06 ` ian at airs dot com
                   ` (15 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-01 16:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2005-11-01 16:17 -------
If we change (*p1)[d-1] to (*p1)[d], we get:
.L2:
    movl 8(%edi), %eax
    movswl  (%eax),%edx
    movl 4(%edi), %eax
    movswl  (%eax),%eax
    subl %edx, %eax
    movl %eax, %ecx
    sarl $31, %ecx
    xorl %ecx, %eax
    subl %ecx, %eax
    movl (%edi), %ecx
    movswl  (%ecx),%ecx
    subl %ecx, %edx
    movl %edx, %ecx
    sarl $31, %ecx
    xorl %ecx, %edx
    subl %ecx, %edx
    cmpl %edx, %eax
    movl 8(%ebp), %edx
    setge   %al
    movzbl  %al, %eax
    incl %eax
    movl %eax, -4(%edx,%esi,4)
    incl %esi
    movl %eax, 8(%esp)
    movsbl  (%edi,%eax),%eax
    movl %ebx, (%esp)
    addl $32, %ebx
    movl %eax, 4(%esp)
    call bar
    addl %eax, -16(%ebp)
    cmpl $7, %esi
    jne .L2
For the loop, which seems like very good as there are no branches, only
    setge   %al
    movzbl  %al, %eax
    incl %eax


-- 


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


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

* [Bug tree-optimization/24609] Same value duplicated in two different registers
  2005-11-01  5:33 [Bug tree-optimization/24609] New: Same value duplicated in two different registers ian at airs dot com
                   ` (3 preceding siblings ...)
  2005-11-01 16:17 ` pinskia at gcc dot gnu dot org
@ 2005-11-01 18:06 ` ian at airs dot com
  2005-11-01 18:46 ` ian at airs dot com
                   ` (14 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: ian at airs dot com @ 2005-11-01 18:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from ian at airs dot com  2005-11-01 18:06 -------
That means that you did get only one register, and that therefore the block was
simple enough for RTL if-conversion to operate.

So I'd still like to understand why we get two identical registers in the
original test case, which is clearly bad.


-- 


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


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

* [Bug tree-optimization/24609] Same value duplicated in two different registers
  2005-11-01  5:33 [Bug tree-optimization/24609] New: Same value duplicated in two different registers ian at airs dot com
                   ` (4 preceding siblings ...)
  2005-11-01 18:06 ` ian at airs dot com
@ 2005-11-01 18:46 ` ian at airs dot com
  2005-11-01 18:47 ` [Bug tree-optimization/24609] [4.1 regression] " ian at airs dot com
                   ` (13 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: ian at airs dot com @ 2005-11-01 18:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from ian at airs dot com  2005-11-01 18:46 -------
Created an attachment (id=10101)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10101&action=view)
.s file from gcc 3.4 -S -O2

I've attached the assembler code generated by gcc 3.4 with -S -O2.  This code
is much better than that generated by 4.1.  It does not duplicate the register,
and RTL if-conversion is able to eliminate the branch.


-- 


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


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

* [Bug tree-optimization/24609] [4.1 regression] Same value duplicated in two different registers
  2005-11-01  5:33 [Bug tree-optimization/24609] New: Same value duplicated in two different registers ian at airs dot com
                   ` (5 preceding siblings ...)
  2005-11-01 18:46 ` ian at airs dot com
@ 2005-11-01 18:47 ` ian at airs dot com
  2005-11-02  0:58 ` ian at airs dot com
                   ` (12 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: ian at airs dot com @ 2005-11-01 18:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from ian at airs dot com  2005-11-01 18:47 -------
Because the 4.1 code is worse than the 3.4 code, I believe that this is a 4.1
regression, and I am marking it as such.  Please correct me if I made a
mistake.


-- 

ian at airs dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Same value duplicated in two|[4.1 regression] Same value
                   |different registers         |duplicated in two different
                   |                            |registers


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


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

* [Bug tree-optimization/24609] [4.1 regression] Same value duplicated in two different registers
  2005-11-01  5:33 [Bug tree-optimization/24609] New: Same value duplicated in two different registers ian at airs dot com
                   ` (6 preceding siblings ...)
  2005-11-01 18:47 ` [Bug tree-optimization/24609] [4.1 regression] " ian at airs dot com
@ 2005-11-02  0:58 ` ian at airs dot com
  2005-11-03  6:28 ` ian at airs dot com
                   ` (11 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: ian at airs dot com @ 2005-11-02  0:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from ian at airs dot com  2005-11-02 00:58 -------
Created an attachment (id=10111)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10111&action=view)
Another test case for the same sort of problem

This is another test case for the same sort of problem.  When compiled with
-O2, this again stores the same value in two different registers.  In this case
the compiler is faithfully repeating the code, but it would be nice if the
compiler were smart enough to see that it can eliminate one of the registers.


-- 


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


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

* [Bug tree-optimization/24609] [4.1 regression] Same value duplicated in two different registers
  2005-11-01  5:33 [Bug tree-optimization/24609] New: Same value duplicated in two different registers ian at airs dot com
                   ` (7 preceding siblings ...)
  2005-11-02  0:58 ` ian at airs dot com
@ 2005-11-03  6:28 ` ian at airs dot com
  2006-03-08 16:03 ` [Bug tree-optimization/24609] [4.1/4.2 " pinskia at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: ian at airs dot com @ 2005-11-03  6:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from ian at airs dot com  2005-11-03 06:28 -------
Created an attachment (id=10116)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10116&action=view)
Patch for RTL if-conversion

This is a patch for RTL if-conversion which fixes this particular bug on i686. 
It's not a real fix for the underlying issue.  It just improves RTL
if-conversion so that it supports multiple simple conditional moves.  I'm not
sure whether this is a good idea or not.


-- 


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


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

* [Bug tree-optimization/24609] [4.1/4.2 regression] Same value duplicated in two different registers
  2005-11-01  5:33 [Bug tree-optimization/24609] New: Same value duplicated in two different registers ian at airs dot com
                   ` (8 preceding siblings ...)
  2005-11-03  6:28 ` ian at airs dot com
@ 2006-03-08 16:03 ` pinskia at gcc dot gnu dot org
  2006-04-12 18:36 ` mmitchel at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-08 16:03 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.1


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


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

* [Bug tree-optimization/24609] [4.1/4.2 regression] Same value duplicated in two different registers
  2005-11-01  5:33 [Bug tree-optimization/24609] New: Same value duplicated in two different registers ian at airs dot com
                   ` (9 preceding siblings ...)
  2006-03-08 16:03 ` [Bug tree-optimization/24609] [4.1/4.2 " pinskia at gcc dot gnu dot org
@ 2006-04-12 18:36 ` mmitchel at gcc dot gnu dot org
  2006-04-27 12:36 ` rguenth at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-04-12 18:36 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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

* [Bug tree-optimization/24609] [4.1/4.2 regression] Same value duplicated in two different registers
  2005-11-01  5:33 [Bug tree-optimization/24609] New: Same value duplicated in two different registers ian at airs dot com
                   ` (10 preceding siblings ...)
  2006-04-12 18:36 ` mmitchel at gcc dot gnu dot org
@ 2006-04-27 12:36 ` rguenth at gcc dot gnu dot org
  2006-05-25  2:40 ` mmitchel at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-04-27 12:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from rguenth at gcc dot gnu dot org  2006-04-27 12:36 -------
I cannot reproduce this anymore on 4.1 or mainline.  (I can however see the
const duplication by PRE)


-- 


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


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

* [Bug tree-optimization/24609] [4.1/4.2 regression] Same value duplicated in two different registers
  2005-11-01  5:33 [Bug tree-optimization/24609] New: Same value duplicated in two different registers ian at airs dot com
                   ` (11 preceding siblings ...)
  2006-04-27 12:36 ` rguenth at gcc dot gnu dot org
@ 2006-05-25  2:40 ` mmitchel at gcc dot gnu dot org
  2006-07-10 13:01 ` [Bug tree-optimization/24609] [4.0/4.1/4.2 " rguenth at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-05-25  2:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from mmitchel at gcc dot gnu dot org  2006-05-25 02:33 -------
Will not be fixed in 4.1.1; adjust target milestone to 4.1.2.


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.1                       |4.1.2


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


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

* [Bug tree-optimization/24609] [4.0/4.1/4.2 regression] Same value duplicated in two different registers
  2005-11-01  5:33 [Bug tree-optimization/24609] New: Same value duplicated in two different registers ian at airs dot com
                   ` (12 preceding siblings ...)
  2006-05-25  2:40 ` mmitchel at gcc dot gnu dot org
@ 2006-07-10 13:01 ` rguenth at gcc dot gnu dot org
  2006-08-25  7:47 ` bonzini at gnu dot org
                   ` (5 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-07-10 13:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from rguenth at gcc dot gnu dot org  2006-07-10 13:00 -------
This seems to worked around on the mainline and also fails for 4.0.3.

Basically, on the mainline you can still see the behavior if using
-fno-if-conversion.

Short testcase:

int
foo (int *a, char * p)
{
  int d;

  if (p)
    d = 1;
  else
    d = 2;
  a[0] = d;

  return p[d - 1];
}


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to fail|                            |4.0.3 4.1.0 4.1.1 4.2.0
      Known to work|                            |3.4.6
   Last reconfirmed|0000-00-00 00:00:00         |2006-07-10 13:00:56
               date|                            |
            Summary|[4.1/4.2 regression] Same   |[4.0/4.1/4.2 regression]
                   |value duplicated in two     |Same value duplicated in two
                   |different registers         |different registers


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


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

* [Bug tree-optimization/24609] [4.0/4.1/4.2 regression] Same value duplicated in two different registers
  2005-11-01  5:33 [Bug tree-optimization/24609] New: Same value duplicated in two different registers ian at airs dot com
                   ` (13 preceding siblings ...)
  2006-07-10 13:01 ` [Bug tree-optimization/24609] [4.0/4.1/4.2 " rguenth at gcc dot gnu dot org
@ 2006-08-25  7:47 ` bonzini at gnu dot org
  2006-08-25  7:48 ` bonzini at gnu dot org
                   ` (4 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: bonzini at gnu dot org @ 2006-08-25  7:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from bonzini at gnu dot org  2006-08-25 07:47 -------
PRE is eliminating

  char *d.0_6;
  d.0_6 = (char *) d_1;

by turning it into

  char * prephitmp.24;
  d.0_6 = prephitmp.24_14;

I think that not all casts should not be subject to PRE.


-- 

bonzini at gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bonzini at gnu dot org


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


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

* [Bug tree-optimization/24609] [4.0/4.1/4.2 regression] Same value duplicated in two different registers
  2005-11-01  5:33 [Bug tree-optimization/24609] New: Same value duplicated in two different registers ian at airs dot com
                   ` (14 preceding siblings ...)
  2006-08-25  7:47 ` bonzini at gnu dot org
@ 2006-08-25  7:48 ` bonzini at gnu dot org
  2007-02-14  9:08 ` [Bug tree-optimization/24609] [4.0/4.1/4.2/4.3 " mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: bonzini at gnu dot org @ 2006-08-25  7:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from bonzini at gnu dot org  2006-08-25 07:48 -------
Sorry, by turning it into

  char * prephitmp.24;
  # prephitmp.24_14 = PHI <1B(5), 2B(3)>;
  d.0_6 = prephitmp.24_14;

I think that not all casts should be subject to PRE.


-- 

bonzini at gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2006-07-10 13:00:56         |2006-08-25 07:48:31
               date|                            |


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


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

* [Bug tree-optimization/24609] [4.0/4.1/4.2/4.3 regression] Same value duplicated in two different registers
  2005-11-01  5:33 [Bug tree-optimization/24609] New: Same value duplicated in two different registers ian at airs dot com
                   ` (15 preceding siblings ...)
  2006-08-25  7:48 ` bonzini at gnu dot org
@ 2007-02-14  9:08 ` mmitchel at gcc dot gnu dot org
  2007-07-04 22:11 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-02-14  9:08 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.2                       |4.1.3


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


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

* [Bug tree-optimization/24609] [4.0/4.1/4.2/4.3 regression] Same value duplicated in two different registers
  2005-11-01  5:33 [Bug tree-optimization/24609] New: Same value duplicated in two different registers ian at airs dot com
                   ` (16 preceding siblings ...)
  2007-02-14  9:08 ` [Bug tree-optimization/24609] [4.0/4.1/4.2/4.3 " mmitchel at gcc dot gnu dot org
@ 2007-07-04 22:11 ` pinskia at gcc dot gnu dot org
  2008-01-21 17:26 ` steven at gcc dot gnu dot org
  2008-01-23  6:49 ` ian at airs dot com
  19 siblings, 0 replies; 21+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-07-04 22:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from pinskia at gcc dot gnu dot org  2007-07-04 22:11 -------
For foo4.c
> SCCVN says j_3 value numbers to i_2 (VH.3)
But that is really PR 28868.

The orginal issue here I think is fixed because we now use unsigned int for the
addition.
The IR looks like:

<bb 4>:
  d = 2;
  prephitmp.39 = 1;
  goto <bb 6>;

<bb 5>:
  d = 1;
  prephitmp.39 = 0;

<bb 6>:
  MEM[base: a, index: ivtmp.49, step: 4, offset: 4294967292] = d;
  D.2029 = bar ((short int *) ivtmp.52, (int) (short int) *(pretmp.36 +
prephitmp.39), d);

Which looks good as there is no duplicated value.  Note the offset of -4 is a
different and already known issue.

Ian do you think this should no longer be a 4.3 Regression or should we even
not PRE "PHI<1,2> - 1" ?


-- 


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


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

* [Bug tree-optimization/24609] [4.0/4.1/4.2/4.3 regression] Same value duplicated in two different registers
  2005-11-01  5:33 [Bug tree-optimization/24609] New: Same value duplicated in two different registers ian at airs dot com
                   ` (17 preceding siblings ...)
  2007-07-04 22:11 ` pinskia at gcc dot gnu dot org
@ 2008-01-21 17:26 ` steven at gcc dot gnu dot org
  2008-01-23  6:49 ` ian at airs dot com
  19 siblings, 0 replies; 21+ messages in thread
From: steven at gcc dot gnu dot org @ 2008-01-21 17:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from steven at gcc dot gnu dot org  2008-01-21 17:10 -------
It's been half a year since anyone said anything about this bug...

Ian, pinski asked you a question.  Thoughts?


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING


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


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

* [Bug tree-optimization/24609] [4.0/4.1/4.2/4.3 regression] Same value duplicated in two different registers
  2005-11-01  5:33 [Bug tree-optimization/24609] New: Same value duplicated in two different registers ian at airs dot com
                   ` (18 preceding siblings ...)
  2008-01-21 17:26 ` steven at gcc dot gnu dot org
@ 2008-01-23  6:49 ` ian at airs dot com
  19 siblings, 0 replies; 21+ messages in thread
From: ian at airs dot com @ 2008-01-23  6:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from ian at airs dot com  2008-01-23 05:55 -------
This is fixed in mainline.


-- 

ian at airs dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.1.3                       |4.3.0


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


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

end of thread, other threads:[~2008-01-23  5:55 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-01  5:33 [Bug tree-optimization/24609] New: Same value duplicated in two different registers ian at airs dot com
2005-11-01  6:02 ` [Bug tree-optimization/24609] " ian at airs dot com
2005-11-01 14:54 ` pinskia at gcc dot gnu dot org
2005-11-01 16:09 ` ian at airs dot com
2005-11-01 16:17 ` pinskia at gcc dot gnu dot org
2005-11-01 18:06 ` ian at airs dot com
2005-11-01 18:46 ` ian at airs dot com
2005-11-01 18:47 ` [Bug tree-optimization/24609] [4.1 regression] " ian at airs dot com
2005-11-02  0:58 ` ian at airs dot com
2005-11-03  6:28 ` ian at airs dot com
2006-03-08 16:03 ` [Bug tree-optimization/24609] [4.1/4.2 " pinskia at gcc dot gnu dot org
2006-04-12 18:36 ` mmitchel at gcc dot gnu dot org
2006-04-27 12:36 ` rguenth at gcc dot gnu dot org
2006-05-25  2:40 ` mmitchel at gcc dot gnu dot org
2006-07-10 13:01 ` [Bug tree-optimization/24609] [4.0/4.1/4.2 " rguenth at gcc dot gnu dot org
2006-08-25  7:47 ` bonzini at gnu dot org
2006-08-25  7:48 ` bonzini at gnu dot org
2007-02-14  9:08 ` [Bug tree-optimization/24609] [4.0/4.1/4.2/4.3 " mmitchel at gcc dot gnu dot org
2007-07-04 22:11 ` pinskia at gcc dot gnu dot org
2008-01-21 17:26 ` steven at gcc dot gnu dot org
2008-01-23  6:49 ` ian at airs dot com

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