public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/12227] New: wrong calling of functions in certain circumstances (see the sample code)
@ 2003-09-09 17:49 l_belev at yahoo dot com
  2003-09-09 17:56 ` [Bug optimization/12227] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: l_belev at yahoo dot com @ 2003-09-09 17:49 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: wrong calling of functions in certain circumstances (see
                    the sample code)
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: l_belev at yahoo dot com
                CC: gcc-bugs at gcc dot gnu dot org

/*
 * this sample should print AbCdEf and does it
 * when it's compiled with -O0 or -O3, but when
 * it's compiled with -O1 or -O2, it incorrectly
 * prints ABCDEF. I looked at the generated assembler
 * code, and obviously it's erroneous.
 * (the external func putchar does not interfere with
 * this gcc bug - without it the generated code is bad too)
 */

int lower(int x) { return x + 'a'; }
int upper(int x) { return x + 'A'; }

int main()
{
	int k;

	for (k = 0; k < 6; k++)
		putchar(((k & 1) ? lower : upper)(k));

	putchar('\n');
	return 0;
}


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

* [Bug optimization/12227] wrong calling of functions in certain circumstances (see the sample code)
  2003-09-09 17:49 [Bug optimization/12227] New: wrong calling of functions in certain circumstances (see the sample code) l_belev at yahoo dot com
@ 2003-09-09 17:56 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-09-09 17:56 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
           Keywords|                            |wrong-code
         Resolution|                            |DUPLICATE
   Target Milestone|---                         |3.3.1


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-09-09 17:56 -------
This is a dup of bug 11557 which is fixed in 3.3.1.

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


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

end of thread, other threads:[~2003-09-09 17:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-09 17:49 [Bug optimization/12227] New: wrong calling of functions in certain circumstances (see the sample code) l_belev at yahoo dot com
2003-09-09 17:56 ` [Bug optimization/12227] " 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).