public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/26544] printf calls optimized at -O0
  2006-03-03 10:28 [Bug c/26544] New: printf calls optimized at -O0 nathan at gcc dot gnu dot org
@ 2006-03-03 10:28 ` nathan at gcc dot gnu dot org
  2006-03-03 10:29 ` nathan at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: nathan at gcc dot gnu dot org @ 2006-03-03 10:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from nathan at gcc dot gnu dot org  2006-03-03 10:28 -------
Created an attachment (id=10960)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10960&action=view)
testcase


-- 


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


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

* [Bug c/26544]  New: printf calls optimized at -O0
@ 2006-03-03 10:28 nathan at gcc dot gnu dot org
  2006-03-03 10:28 ` [Bug c/26544] " nathan at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: nathan at gcc dot gnu dot org @ 2006-03-03 10:28 UTC (permalink / raw)
  To: gcc-bugs

the attached program compiles the printf call to puts, even when optimization
is disabled.  This seems confusing.


-- 
           Summary: printf calls optimized at -O0
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: nathan at gcc dot gnu dot org


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


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

* [Bug c/26544] printf calls optimized at -O0
  2006-03-03 10:28 [Bug c/26544] New: printf calls optimized at -O0 nathan at gcc dot gnu dot org
  2006-03-03 10:28 ` [Bug c/26544] " nathan at gcc dot gnu dot org
@ 2006-03-03 10:29 ` nathan at gcc dot gnu dot org
  2006-03-03 12:37 ` [Bug middle-end/26544] " pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: nathan at gcc dot gnu dot org @ 2006-03-03 10:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from nathan at gcc dot gnu dot org  2006-03-03 10:29 -------
Created an attachment (id=10961)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10961&action=view)
i686 assembler 


-- 


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


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

* [Bug middle-end/26544] printf calls optimized at -O0
  2006-03-03 10:28 [Bug c/26544] New: printf calls optimized at -O0 nathan at gcc dot gnu dot org
  2006-03-03 10:28 ` [Bug c/26544] " nathan at gcc dot gnu dot org
  2006-03-03 10:29 ` nathan at gcc dot gnu dot org
@ 2006-03-03 12:37 ` pinskia at gcc dot gnu dot org
  2006-03-03 12:50 ` nathan at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-03 12:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-03-03 12:37 -------
How is this confusing?  We simplify/fold builtins and other expressions at -O0
all the time.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |middle-end


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


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

* [Bug middle-end/26544] printf calls optimized at -O0
  2006-03-03 10:28 [Bug c/26544] New: printf calls optimized at -O0 nathan at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-03-03 12:37 ` [Bug middle-end/26544] " pinskia at gcc dot gnu dot org
@ 2006-03-03 12:50 ` nathan at gcc dot gnu dot org
  2007-11-15 17:44 ` manu at gcc dot gnu dot org
  2008-01-26 13:04 ` rguenth at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: nathan at gcc dot gnu dot org @ 2006-03-03 12:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from nathan at gcc dot gnu dot org  2006-03-03 12:49 -------
I find it a surprise that when not optimizing, the compiler has examined the
printf string and determined it can replace the printf with a puts call.  This
seems more than mere constant folding.


-- 


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


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

* [Bug middle-end/26544] printf calls optimized at -O0
  2006-03-03 10:28 [Bug c/26544] New: printf calls optimized at -O0 nathan at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-03-03 12:50 ` nathan at gcc dot gnu dot org
@ 2007-11-15 17:44 ` manu at gcc dot gnu dot org
  2008-01-26 13:04 ` rguenth at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-11-15 17:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from manu at gcc dot gnu dot org  2007-11-15 17:43 -------
This is either a bug or not. I think that if it is not mere constant folding
and it takes some effort, we should not do it. So let's decide so we can either
confirm it or close it as invalid.


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu dot org
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug middle-end/26544] printf calls optimized at -O0
  2006-03-03 10:28 [Bug c/26544] New: printf calls optimized at -O0 nathan at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-11-15 17:44 ` manu at gcc dot gnu dot org
@ 2008-01-26 13:04 ` rguenth at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-01-26 13:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from rguenth at gcc dot gnu dot org  2008-01-26 12:33 -------
There is not a canonical interpretation of non-optimizing within gcc.  If there
is interest in such, proposals are welcome.

Closing as WONTFIX until there is consensus what should be done at -O0 and what
not.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |WONTFIX


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


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

end of thread, other threads:[~2008-01-26 12:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-03 10:28 [Bug c/26544] New: printf calls optimized at -O0 nathan at gcc dot gnu dot org
2006-03-03 10:28 ` [Bug c/26544] " nathan at gcc dot gnu dot org
2006-03-03 10:29 ` nathan at gcc dot gnu dot org
2006-03-03 12:37 ` [Bug middle-end/26544] " pinskia at gcc dot gnu dot org
2006-03-03 12:50 ` nathan at gcc dot gnu dot org
2007-11-15 17:44 ` manu at gcc dot gnu dot org
2008-01-26 13:04 ` rguenth 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).