public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c
       [not found] <bug-29589-4@http.gcc.gnu.org/bugzilla/>
@ 2011-11-29 23:20 ` pinskia at gcc dot gnu.org
  2011-11-30  9:32 ` mikpe at it dot uu.se
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-11-29 23:20 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
         AssignedTo|pinskia at gcc dot gnu.org  |unassigned at gcc dot
                   |                            |gnu.org

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-11-29 23:16:23 UTC ---
No longer working on this and I lost the patch.


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

* [Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c
       [not found] <bug-29589-4@http.gcc.gnu.org/bugzilla/>
  2011-11-29 23:20 ` [Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c pinskia at gcc dot gnu.org
@ 2011-11-30  9:32 ` mikpe at it dot uu.se
  2012-03-02 19:17 ` bernhard.kaindl at thalesgroup dot com
  2013-12-26 23:13 ` steven at gcc dot gnu.org
  3 siblings, 0 replies; 11+ messages in thread
From: mikpe at it dot uu.se @ 2011-11-30  9:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Mikael Pettersson <mikpe at it dot uu.se> 2011-11-30 08:37:49 UTC ---
I can reproduce the bug on powerpc64-linux with gcc-4.2.4 -O2 -m32/-m64, but
not with gcc-4.3.6, 4.4.6, 4.5.3, 4.6.1, or 4.7-current, with either -m32 or
-m64.
Close as fixed?


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

* [Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c
       [not found] <bug-29589-4@http.gcc.gnu.org/bugzilla/>
  2011-11-29 23:20 ` [Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c pinskia at gcc dot gnu.org
  2011-11-30  9:32 ` mikpe at it dot uu.se
@ 2012-03-02 19:17 ` bernhard.kaindl at thalesgroup dot com
  2013-12-26 23:13 ` steven at gcc dot gnu.org
  3 siblings, 0 replies; 11+ messages in thread
From: bernhard.kaindl at thalesgroup dot com @ 2012-03-02 19:17 UTC (permalink / raw)
  To: gcc-bugs

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

Bernhard Kaindl <bernhard.kaindl at thalesgroup dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bernhard.kaindl at
                   |                            |thalesgroup dot com

--- Comment #10 from Bernhard Kaindl <bernhard.kaindl at thalesgroup dot com> 2012-03-02 19:16:13 UTC ---
Verification using gcc-4.4.6 --target=powerpc-linux --host=i686-linux:

The test case works with -O2, -Os as well as -O3 -no-inline with this
cross-gcc,
but when using -O1, the test case still calls abort() -> foo returns 0 in gdb,
so it has been improved, but not completely fixed in 4.4.6


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

* [Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c
       [not found] <bug-29589-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2012-03-02 19:17 ` bernhard.kaindl at thalesgroup dot com
@ 2013-12-26 23:13 ` steven at gcc dot gnu.org
  3 siblings, 0 replies; 11+ messages in thread
From: steven at gcc dot gnu.org @ 2013-12-26 23:13 UTC (permalink / raw)
  To: gcc-bugs

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

Steven Bosscher <steven at gcc dot gnu.org> changed:

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

--- Comment #11 from Steven Bosscher <steven at gcc dot gnu.org> ---
Merry Christmas!

*** This bug has been marked as a duplicate of bug 57829 ***


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

* [Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c
  2006-10-25  2:09 [Bug rtl-optimization/29589] New: " cqfu at transmeta dot com
                   ` (5 preceding siblings ...)
  2008-02-03 14:40 ` steven at gcc dot gnu dot org
@ 2008-02-03 19:31 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-02-03 19:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2008-02-03 19:30 -------
(In reply to comment #6)
> Andrew, ping about your fix?

I have to extract it, it has changed since the bug was originally sent out.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |ASSIGNED
   Last reconfirmed|2007-06-07 21:00:43         |2008-02-03 19:30:25
               date|                            |


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


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

* [Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c
  2006-10-25  2:09 [Bug rtl-optimization/29589] New: " cqfu at transmeta dot com
                   ` (4 preceding siblings ...)
  2007-06-11  4:44 ` pinskia at gcc dot gnu dot org
@ 2008-02-03 14:40 ` steven at gcc dot gnu dot org
  2008-02-03 19:31 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 11+ messages in thread
From: steven at gcc dot gnu dot org @ 2008-02-03 14:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from steven at gcc dot gnu dot org  2008-02-03 14:39 -------
Andrew, ping about your fix?


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |WAITING


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


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

* [Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c
  2006-10-25  2:09 [Bug rtl-optimization/29589] New: " cqfu at transmeta dot com
                   ` (3 preceding siblings ...)
  2007-06-07 21:00 ` pinskia at gcc dot gnu dot org
@ 2007-06-11  4:44 ` pinskia at gcc dot gnu dot org
  2008-02-03 14:40 ` steven at gcc dot gnu dot org
  2008-02-03 19:31 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-06-11  4:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2007-06-11 04:44 -------
I have a fix from our local tree which also fixes up the regression which we
found with a different patch.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


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

* [Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c
  2006-10-25  2:09 [Bug rtl-optimization/29589] New: " cqfu at transmeta dot com
                   ` (2 preceding siblings ...)
  2006-10-25  3:07 ` pinskia at gcc dot gnu dot org
@ 2007-06-07 21:00 ` pinskia at gcc dot gnu dot org
  2007-06-11  4:44 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-06-07 21:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2007-06-07 21:00 -------
And here is a testcase which makes this reproduciable on the trunk (on
powerpc-linux):
extern void abort (void);
extern void exit (int);

_Bool a;

int foo ()
{
  int b;
  int c = a;
  c = __builtin_abs(c);
  c = c-1;
  c = (c) >>31;
  b = c | 60;
  return b;
}

int main(int argc, char **argv)
{
    a = 1;
    if (foo() != 0x3c)
       abort();
    exit(0);
}


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
 GCC target triplet|                            |powerpc-*-*
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2007-06-07 21:00:43
               date|                            |


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


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

* [Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c
  2006-10-25  2:09 [Bug rtl-optimization/29589] New: " cqfu at transmeta dot com
  2006-10-25  2:23 ` [Bug rtl-optimization/29589] " dje at transmeta dot com
  2006-10-25  2:41 ` dje at transmeta dot com
@ 2006-10-25  3:07 ` pinskia at gcc dot gnu dot org
  2007-06-07 21:00 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-25  3:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-10-25 03:07 -------
Revision 1.169 / (download) - annotate - [select for diffs] , Fri May 6
16:42:40 1994 UTC (12 years, 5 months ago) by kenner
Branch: MAIN
Changes since 1.168: +123 -91 lines
Diff to previous 1.168 (colored)

(simplify_rtx, case MULT): Don't convert MULT to shift here.
(simplify_logical, case IOR): Convert back to PLUS if valid and it will
combine with another PLUS.
(extract_left_shift): New function.
(make_compound_operation, case ASHIFTRT): Simplify by calling it.
(force_to_mode): Don't ignore if X is a SUBREG.
(force_to_mode, case AND): Try to turn unchecked bits on instead of just off
and see which is cheaper.


-- 


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


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

* [Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c
  2006-10-25  2:09 [Bug rtl-optimization/29589] New: " cqfu at transmeta dot com
  2006-10-25  2:23 ` [Bug rtl-optimization/29589] " dje at transmeta dot com
@ 2006-10-25  2:41 ` dje at transmeta dot com
  2006-10-25  3:07 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: dje at transmeta dot com @ 2006-10-25  2:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dje at transmeta dot com  2006-10-25 02:41 -------
Thinking about it some more, disregard this (I think):

- nonzero_bits returns bits that may be one, not bits that are one, so it's not
clear this optimization is valid regardless of anything else

I _think_ this is the culprit, though it's not worded very well:

- op1 is shifted outside the mode of the operation (0x3c << 31) (HOST_WIDE_INT
is 64 bits) and this value is the value AND'd with the result of nonzero_bits.

I think that's what you want, but "We do this by seeing if OP1 can be safely
shifted left C bits" doesn't take into account the mode of the operation.

Just guessing though.


-- 


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


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

* [Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c
  2006-10-25  2:09 [Bug rtl-optimization/29589] New: " cqfu at transmeta dot com
@ 2006-10-25  2:23 ` dje at transmeta dot com
  2006-10-25  2:41 ` dje at transmeta dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: dje at transmeta dot com @ 2006-10-25  2:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from dje at transmeta dot com  2006-10-25 02:23 -------
Re: "We think may be what wanted is:" ...

That's just off the cuff speculation.  The curious things are:

- op1 is shifted outside the mode of the operation (0x3c << 31) (HOST_WIDE_INT
is 64 bits) and this value is the value AND'd with the result of nonzero_bits.

- nonzero_bits returns bits that may be one, not bits that are one, so it's not
clear this optimization is valid regardless of anything else


-- 

dje at transmeta dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|incorrect conversion of (ior|incorrect conversion of (ior
                   |(ashiftrt (plus ...))) in   |(ashiftrt (plus ...))) in
                   |combine.c                   |combine.c


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


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

end of thread, other threads:[~2013-12-26 23:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-29589-4@http.gcc.gnu.org/bugzilla/>
2011-11-29 23:20 ` [Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c pinskia at gcc dot gnu.org
2011-11-30  9:32 ` mikpe at it dot uu.se
2012-03-02 19:17 ` bernhard.kaindl at thalesgroup dot com
2013-12-26 23:13 ` steven at gcc dot gnu.org
2006-10-25  2:09 [Bug rtl-optimization/29589] New: " cqfu at transmeta dot com
2006-10-25  2:23 ` [Bug rtl-optimization/29589] " dje at transmeta dot com
2006-10-25  2:41 ` dje at transmeta dot com
2006-10-25  3:07 ` pinskia at gcc dot gnu dot org
2007-06-07 21:00 ` pinskia at gcc dot gnu dot org
2007-06-11  4:44 ` pinskia at gcc dot gnu dot org
2008-02-03 14:40 ` steven at gcc dot gnu dot org
2008-02-03 19:31 ` pinskia 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).