public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/35307]  New: Missing Simplication for div op
@ 2008-02-23  5:17 xinliangli at gmail dot com
  2008-02-23 19:58 ` [Bug middle-end/35307] " segher at kernel dot crashing dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: xinliangli at gmail dot com @ 2008-02-23  5:17 UTC (permalink / raw)
  To: gcc-bugs

The following rule is good to have:

int i, i, k;

  i/j/k ===>  i/(j*k)


-- 
           Summary: Missing Simplication for div op
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: xinliangli at gmail dot com


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


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

* [Bug middle-end/35307] Missing Simplication for div op
  2008-02-23  5:17 [Bug middle-end/35307] New: Missing Simplication for div op xinliangli at gmail dot com
@ 2008-02-23 19:58 ` segher at kernel dot crashing dot org
  2008-02-23 20:01 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: segher at kernel dot crashing dot org @ 2008-02-23 19:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from segher at kernel dot crashing dot org  2008-02-23 19:57 -------
Not equivalent in the presence of overflow.


-- 


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


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

* [Bug middle-end/35307] Missing Simplication for div op
  2008-02-23  5:17 [Bug middle-end/35307] New: Missing Simplication for div op xinliangli at gmail dot com
  2008-02-23 19:58 ` [Bug middle-end/35307] " segher at kernel dot crashing dot org
@ 2008-02-23 20:01 ` pinskia at gcc dot gnu dot org
  2008-02-24 22:17 ` rguenth at gcc dot gnu dot org
  2008-02-26 16:17 ` segher at kernel dot crashing dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-02-23 20:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2008-02-23 20:00 -------
(In reply to comment #1)
> Not equivalent in the presence of overflow.

You mean defined overflow :).


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
           Keywords|                            |missed-optimization


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


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

* [Bug middle-end/35307] Missing Simplication for div op
  2008-02-23  5:17 [Bug middle-end/35307] New: Missing Simplication for div op xinliangli at gmail dot com
  2008-02-23 19:58 ` [Bug middle-end/35307] " segher at kernel dot crashing dot org
  2008-02-23 20:01 ` pinskia at gcc dot gnu dot org
@ 2008-02-24 22:17 ` rguenth at gcc dot gnu dot org
  2008-02-26 16:17 ` segher at kernel dot crashing dot org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-02-24 22:17 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-02-24 22:16:29
               date|                            |
            Version|unknown                     |4.3.0


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


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

* [Bug middle-end/35307] Missing Simplication for div op
  2008-02-23  5:17 [Bug middle-end/35307] New: Missing Simplication for div op xinliangli at gmail dot com
                   ` (2 preceding siblings ...)
  2008-02-24 22:17 ` rguenth at gcc dot gnu dot org
@ 2008-02-26 16:17 ` segher at kernel dot crashing dot org
  3 siblings, 0 replies; 5+ messages in thread
From: segher at kernel dot crashing dot org @ 2008-02-26 16:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from segher at kernel dot crashing dot org  2008-02-26 16:16 -------
> > Not equivalent in the presence of overflow.
> 
> You mean defined overflow :).

No, I mean overflow.

Let's assume int is 16-bit (just to keep the numbers smallish);
now take i=1, j=1000, k=1000.  i/j/k is perfectly well-defined,
but i/(j*k) overflows in the j*k computation.


Segher


-- 

segher at kernel dot crashing dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |segher at kernel dot
                   |                            |crashing dot org


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


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

end of thread, other threads:[~2008-02-26 16:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-23  5:17 [Bug middle-end/35307] New: Missing Simplication for div op xinliangli at gmail dot com
2008-02-23 19:58 ` [Bug middle-end/35307] " segher at kernel dot crashing dot org
2008-02-23 20:01 ` pinskia at gcc dot gnu dot org
2008-02-24 22:17 ` rguenth at gcc dot gnu dot org
2008-02-26 16:17 ` segher at kernel dot crashing 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).