public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/50527] New: inconsistent vla align Date: Mon, 26 Sep 2011 14:48:00 -0000 [thread overview] Message-ID: <bug-50527-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50527 Bug #: 50527 Summary: inconsistent vla align Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned@gcc.gnu.org ReportedBy: vries@gcc.gnu.org Created attachment 25367 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25367 testcase, modified from pr43513.c testcase To reproduce on x86_64: ... $ gcc -Os pr43513-align.c --param large-stack-frame=30 $ ./a.out 16byte aligned 7fff5c4ce00c ... The address of the vla is printed, and it's not 16-byte aligned (ends in 'c'). Nevertheless the test whether the address is 16-byte aligned succeeds, and the string '16byte aligned' is printed. During compilation the following scenario happens: - During the propagation of the first ccp phase, the align of the alloca (16) is progagated to the lhs results.0D.3306_13 as lattice value 'CONSTANT 0x00000000000000000 (0xfffffffffffffffffffffffffffffff0)'. - This not propagated through 'D.3307_14 = &*results.0D.3306_13'. The propagation does not look at the lattice value of results.0D.3306_13, but at the alignment of the ptr_info, which at this point is not initialised yet. - During the finalize of the first ccp phase, ptr_info of results.0D.3306_13 is initialized with align 16, based on the lattice value. - During the propagation of the second ccp phase, the align of the ptr_info of results.0D.3306_13 of 16 is used to propagate through to the comparison 'if (D.3309_16 == 0)', which makes sure the '16byte aligned' string is printed. - During the finalize of the second ccp phase, the alloca is folded, and the new declared array gets an align of 4 bytes.
next reply other threads:[~2011-09-26 14:41 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-09-26 14:48 vries at gcc dot gnu.org [this message] 2011-09-26 15:13 ` [Bug middle-end/50527] " rguenth at gcc dot gnu.org 2011-09-26 15:30 ` rguenth at gcc dot gnu.org 2011-09-27 9:29 ` vries at gcc dot gnu.org 2011-09-27 10:06 ` vries at gcc dot gnu.org 2011-09-27 10:08 ` rguenther at suse dot de 2011-09-27 11:11 ` vries at gcc dot gnu.org 2011-09-27 11:25 ` rguenther at suse dot de 2011-09-27 13:47 ` vries at gcc dot gnu.org 2011-10-07 12:50 ` vries at gcc dot gnu.org 2011-10-07 12:51 ` vries at gcc dot gnu.org 2011-10-07 13:38 ` vries at gcc dot gnu.org 2011-10-13 11:10 ` vries at gcc dot gnu.org 2011-10-13 11:18 ` vries 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-50527-4@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: 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).