public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jamborm at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/50444] [4.6/4.7 Regression] -ftree-sra ignores alignment
Date: Wed, 18 Jan 2012 11:57:00 -0000	[thread overview]
Message-ID: <bug-50444-4-lIClPRAbFe@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-50444-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #14 from Martin Jambor <jamborm at gcc dot gnu.org> 2012-01-18 11:23:00 UTC ---
Created attachment 26362
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26362
patch-in-progress

I talked to richi on IRC yesterday and we agreed that because we rely
on build_ref_for_model to create the whole chain of COMPONENT_REFs on
strict alignment platforms, that we would disable some scalarization
in cases like this, after all.

However, in addition to what richi suggested in comment #12, I found
out that that was not enough to make the test pass on i686.  Also,
propagation across assignments is not the only way how these may be
created for the aggregate on the LHS, they might just be there because
of pre-existing accesses elsewhere in the function.

So I looked at the caster dumps again and found out that indeed the
very first assignment 

  MEM[(char * {ref-all})&c1x128] = MEM[(char * {ref-all})&c4x32];

had the LHS replaced by a SRA vector replacement and the RHS by a
reference created by build_ref_for_model with the same problems.  This
lead to a similar situation but with switched sides.

So I looked at where these build_ref_for_model an came up with the
following patch which is fairly straightforward and makes the testcase
pass also on i686.  However, there are two problems with the patch.

1. This is the easy part.  I'm afraid similar problems are lurking in
processing aggregate copies with children accesses.  But those could
be dealt with afterwards.

2. When I bootstrapped gcc and run the testsuite with this patch, I
got a new failure in libstdc++:

  23_containers/forward_list/modifiers/1.cc

The failure persists with -fno-tree-sra, so something went wrong when
compiling the library.  The patch is very simple and only disabling
stuff which then has to through the VIEW_CONVERT_EXPR path so at the
moment I think that either the condition guarding the following

  force_gimple_rhs = true;

is wrong or I have uncovered some other bug :-(


  parent reply	other threads:[~2012-01-18 11:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-17 17:12 [Bug c/50444] New: unaligned movdqa instruction after inlining john.salmon at deshaw dot com
2011-09-25 15:45 ` [Bug c/50444] " john.salmon at deshaw dot com
2011-09-25 18:06 ` rguenth at gcc dot gnu.org
2011-09-26 17:46 ` hjl.tools at gmail dot com
2011-09-26 17:56 ` [Bug c/50444] -ftree-isa ignores alignment hjl.tools at gmail dot com
2011-09-26 20:06 ` hjl.tools at gmail dot com
2011-09-27  8:59 ` rguenther at suse dot de
2011-10-24  7:55 ` [Bug tree-optimization/50444] [4.6/4.7 Regression] -ftree-sra " rguenth at gcc dot gnu.org
2011-10-26 17:38 ` jakub at gcc dot gnu.org
2011-10-27 10:19 ` rguenth at gcc dot gnu.org
2011-12-16 19:59 ` jamborm at gcc dot gnu.org
2011-12-17 15:41 ` ebotcazou at gcc dot gnu.org
2012-01-12 13:47 ` jamborm at gcc dot gnu.org
2012-01-16 15:43 ` rguenth at gcc dot gnu.org
2012-01-16 15:58 ` rguenth at gcc dot gnu.org
2012-01-18 11:57 ` jamborm at gcc dot gnu.org [this message]
2012-01-20 14:27 ` rguenth at gcc dot gnu.org
2012-01-20 15:54 ` rguenth at gcc dot gnu.org
2012-01-27 15:12 ` rguenth at gcc dot gnu.org
2012-01-27 15:23 ` rguenth at gcc dot gnu.org
2012-01-27 15:29 ` [Bug tree-optimization/50444] [4.6 " rguenth at gcc dot gnu.org
2012-03-01 15:21 ` jakub at gcc dot gnu.org
2013-04-12 16:17 ` jakub 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-50444-4-lIClPRAbFe@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).