public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "su at cs dot ucdavis.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/60062] [4.7/4.9 Regression] wrong code (for code with the optimize attribute) at -O1 and above on x86_64-linux-gnu in 32-bit mode
Date: Wed, 05 Feb 2014 15:43:00 -0000	[thread overview]
Message-ID: <bug-60062-4-zAnQFm3la6@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-60062-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from Zhendong Su <su at cs dot ucdavis.edu> ---
(In reply to Jakub Jelinek from comment #4)
> *** Bug 60072 has been marked as a duplicate of this bug. ***

The testcase below is most likely another dup as the only difference is that it
affects the trunk at -Os only. Just include it here for reference. Thanks. 


----------------------------------


int printf (const char *, ...);

int a;

int
fn1 (unsigned char p1)
{
  return p1 % p1;
}

static void
fn2 (char *p1, int p2)
{
  if (p2)
    printf (p1);
}

__attribute__ ((optimize (0)))
int fn3 (short p1, short p2)
{
  a = 0;
  return 0;
}

__attribute__ ((optimize (1)))
int fn4 ()
{
  fn3 (0, 0);
  if (fn1 (1))
    for (;;)
      ;
  return 1;
}

__attribute__ ((optimize (0)))
int main ()
{
  fn4 ();
  fn2 ("", 0);
  return 0;
}


  parent reply	other threads:[~2014-02-05 15:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-04 19:13 [Bug ipa/60062] New: " su at cs dot ucdavis.edu
2014-02-04 19:25 ` [Bug ipa/60062] [4.7/4.9 Regression] " mpolacek at gcc dot gnu.org
2014-02-05  8:23 ` [Bug target/60062] " jakub at gcc dot gnu.org
2014-02-05  9:17 ` jakub at gcc dot gnu.org
2014-02-05 15:43 ` su at cs dot ucdavis.edu [this message]
2014-02-06 10:54 ` jakub at gcc dot gnu.org
2014-02-10  9:41 ` [Bug target/60062] [4.7/4.8 " rguenth at gcc dot gnu.org
2014-02-10  9:42 ` rguenth at gcc dot gnu.org
2014-03-06  7:57 ` jakub at gcc dot gnu.org
2014-04-18  7:32 ` [Bug target/60062] [4.7 " jakub at gcc dot gnu.org
2014-06-12 13:34 ` rguenth at gcc dot gnu.org
2021-08-08 22:22 ` pinskia at gcc dot gnu.org
2021-08-30  1:36 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-60062-4-zAnQFm3la6@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).