public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "dalej at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/21562] New: Quiet bad codegen (unrolling + tail call interaction) Date: Fri, 13 May 2005 23:56:00 -0000 [thread overview] Message-ID: <20050513235619.21562.dalej@gcc.gnu.org> (raw) Compile the following with -O2 -funroll-loops and you get bad codegen. An uninitilaized value is used as "pos" in computing the store address for mr[pos]=1 at the top of the function. The first dump where it's wrong seems to be "nrv". If you unroll by hand it comes out correct. extern int delta[8]; extern unsigned char board[421]; void ping_recurse(int pos, int mr[400], int color) { int k; mr[pos] = 1; for (k = 0; k < 4; k++) { int apos = pos + delta[k]; if (mr[apos] == 1 || board[apos] == color) ping_recurse(apos, mr, color); } } Beginning of codegen on darwin8: _ping_recurse: mflr r0 bcl 20,31,"L00000000001$pb" "L00000000001$pb": stmw r28,-16(r1) mr r29,r4 mflr r31 mr r28,r5 stw r0,8(r1) stwu r1,-80(r1) L25: addis r11,r31,ha16(L_delta$non_lazy_ptr-"L00000000001$pb") slwi r2,r30,2 <<<< R30 uninitiailized -- Summary: Quiet bad codegen (unrolling + tail call interaction) Product: gcc Version: 4.0.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P2 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: dalej at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: powerpc-apple-darwin8.0.0 GCC host triplet: powerpc-apple-darwin8.0.0 GCC target triplet: powerpc-apple-darwin8.0.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21562
next reply other threads:[~2005-05-13 23:56 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2005-05-13 23:56 dalej at gcc dot gnu dot org [this message] 2005-05-14 0:24 ` [Bug tree-optimization/21562] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org 2005-05-14 0:41 ` pinskia at gcc dot gnu dot org 2005-05-14 0:47 ` pinskia at gcc dot gnu dot org 2005-05-16 21:45 ` dalej at gcc dot gnu dot org 2005-05-16 22:54 ` pinskia at gcc dot gnu dot org 2005-05-26 23:33 ` pinskia at gcc dot gnu dot org 2005-05-28 23:48 ` cvs-commit at gcc dot gnu dot org 2005-06-07 7:51 ` [Bug tree-optimization/21562] [4.0 " steven at gcc dot gnu dot org 2005-06-07 11:42 ` pinskia at gcc dot gnu dot org 2005-06-26 1:53 ` mmitchel at gcc dot gnu dot org 2005-06-28 1:29 ` hubicka at ucw dot cz 2005-07-06 16:15 ` mmitchel at gcc dot gnu dot org 2005-07-06 17:04 ` mmitchel at gcc dot gnu dot org 2005-08-05 17:51 ` cvs-commit at gcc dot gnu dot org 2005-08-18 9:51 ` bonzini at gcc dot gnu dot org 2005-08-18 10:11 ` cvs-commit at gcc dot gnu dot 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=20050513235619.21562.dalej@gcc.gnu.org \ --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: linkBe 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).