public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/43835]  New: IPA-SRA doesn't rewrite attributes
@ 2010-04-21 15:06 matz at gcc dot gnu dot org
  2010-04-21 15:09 ` [Bug middle-end/43835] " matz at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: matz at gcc dot gnu dot org @ 2010-04-21 15:06 UTC (permalink / raw)
  To: gcc-bugs

The testcase I'm attaching shortly will be miscompiled by IPA-SRA.
The problem is, that SRA splits the pointer argument 'c' of mark_cell into
two new parameters, one being a pointer itself, and another int param.  But it
doesn't rewrite the attribute list of the fndecl, hence the nonnull attributes
now "apply" to the new parameters.  That's of course bogus and results
in a null-pointer check (on c->p) being optimized out by VRP later.

This happens with simply -O2 (on i686 and x86_64, but it's a generic problem).


-- 
           Summary: IPA-SRA doesn't rewrite attributes
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: matz at gcc dot gnu dot org
  GCC host triplet: i686-linux
GCC target triplet: i686-linux


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


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

* [Bug middle-end/43835] IPA-SRA doesn't rewrite attributes
  2010-04-21 15:06 [Bug middle-end/43835] New: IPA-SRA doesn't rewrite attributes matz at gcc dot gnu dot org
@ 2010-04-21 15:09 ` matz at gcc dot gnu dot org
  2010-04-21 15:52 ` [Bug middle-end/43835] [4.5 Regression] " rguenth at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: matz at gcc dot gnu dot org @ 2010-04-21 15:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from matz at gcc dot gnu dot org  2010-04-21 15:08 -------
Created an attachment (id=20454)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20454&action=view)
testcase

# gcc -O2 sra-nonnull.c && ./a.out
Segmentation fault


-- 


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


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

* [Bug middle-end/43835] [4.5 Regression] IPA-SRA doesn't rewrite attributes
  2010-04-21 15:06 [Bug middle-end/43835] New: IPA-SRA doesn't rewrite attributes matz at gcc dot gnu dot org
  2010-04-21 15:09 ` [Bug middle-end/43835] " matz at gcc dot gnu dot org
@ 2010-04-21 15:52 ` rguenth at gcc dot gnu dot org
  2010-04-21 16:04 ` jamborm at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-04-21 15:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2010-04-21 15:51 -------
Confirmed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-04-21 15:51:44
               date|                            |
            Summary|IPA-SRA doesn't rewrite     |[4.5 Regression] IPA-SRA
                   |attributes                  |doesn't rewrite attributes
   Target Milestone|---                         |4.5.1


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


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

* [Bug middle-end/43835] [4.5 Regression] IPA-SRA doesn't rewrite attributes
  2010-04-21 15:06 [Bug middle-end/43835] New: IPA-SRA doesn't rewrite attributes matz at gcc dot gnu dot org
  2010-04-21 15:09 ` [Bug middle-end/43835] " matz at gcc dot gnu dot org
  2010-04-21 15:52 ` [Bug middle-end/43835] [4.5 Regression] " rguenth at gcc dot gnu dot org
@ 2010-04-21 16:04 ` jamborm at gcc dot gnu dot org
  2010-04-22 17:30 ` jamborm at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jamborm at gcc dot gnu dot org @ 2010-04-21 16:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jamborm at gcc dot gnu dot org  2010-04-21 16:04 -------
Mine


-- 

jamborm at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jamborm at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2010-04-21 15:51:44         |2010-04-21 16:04:22
               date|                            |


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


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

* [Bug middle-end/43835] [4.5 Regression] IPA-SRA doesn't rewrite attributes
  2010-04-21 15:06 [Bug middle-end/43835] New: IPA-SRA doesn't rewrite attributes matz at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2010-04-21 16:04 ` jamborm at gcc dot gnu dot org
@ 2010-04-22 17:30 ` jamborm at gcc dot gnu dot org
  2010-04-23 14:43 ` jamborm at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jamborm at gcc dot gnu dot org @ 2010-04-22 17:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jamborm at gcc dot gnu dot org  2010-04-22 17:30 -------
A fix has been submitted to the mailing list:
http://gcc.gnu.org/ml/gcc-patches/2010-04/msg01400.html


-- 


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


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

* [Bug middle-end/43835] [4.5 Regression] IPA-SRA doesn't rewrite attributes
  2010-04-21 15:06 [Bug middle-end/43835] New: IPA-SRA doesn't rewrite attributes matz at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2010-04-22 17:30 ` jamborm at gcc dot gnu dot org
@ 2010-04-23 14:43 ` jamborm at gcc dot gnu dot org
  2010-04-23 16:16 ` jamborm at gcc dot gnu dot org
  2010-04-23 16:20 ` jamborm at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: jamborm at gcc dot gnu dot org @ 2010-04-23 14:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jamborm at gcc dot gnu dot org  2010-04-23 14:43 -------
Subject: Bug 43835

Author: jamborm
Date: Fri Apr 23 14:43:10 2010
New Revision: 158667

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158667
Log:
2010-04-23  Martin Jambor  <mjambor@suse.cz>

        PR middle-end/43835
        * tree-sra.c (ipa_sra_preliminary_function_checks): Check that the
        function does not have type attributes.

        * testsuite/gcc.c-torture/execute/pr43835.c: New test.


Added:
    trunk/gcc/testsuite/gcc.c-torture/execute/pr43835.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-sra.c


-- 


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


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

* [Bug middle-end/43835] [4.5 Regression] IPA-SRA doesn't rewrite attributes
  2010-04-21 15:06 [Bug middle-end/43835] New: IPA-SRA doesn't rewrite attributes matz at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2010-04-23 14:43 ` jamborm at gcc dot gnu dot org
@ 2010-04-23 16:16 ` jamborm at gcc dot gnu dot org
  2010-04-23 16:20 ` jamborm at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: jamborm at gcc dot gnu dot org @ 2010-04-23 16:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jamborm at gcc dot gnu dot org  2010-04-23 16:16 -------
Subject: Bug 43835

Author: jamborm
Date: Fri Apr 23 16:15:39 2010
New Revision: 158674

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158674
Log:
2010-04-23  Martin Jambor  <mjambor@suse.cz>

        PR middle-end/43835
        * tree-sra.c (ipa_sra_preliminary_function_checks): Check that the
        function does not have type attributes.

        * testsuite/gcc.c-torture/execute/pr43835.c: New test.


Added:
    branches/gcc-4_5-branch/gcc/testsuite/gcc.c-torture/execute/pr43835.c
Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_5-branch/gcc/tree-sra.c


-- 


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


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

* [Bug middle-end/43835] [4.5 Regression] IPA-SRA doesn't rewrite attributes
  2010-04-21 15:06 [Bug middle-end/43835] New: IPA-SRA doesn't rewrite attributes matz at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2010-04-23 16:16 ` jamborm at gcc dot gnu dot org
@ 2010-04-23 16:20 ` jamborm at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: jamborm at gcc dot gnu dot org @ 2010-04-23 16:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jamborm at gcc dot gnu dot org  2010-04-23 16:19 -------
Fixed.


-- 

jamborm at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2010-04-23 16:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-21 15:06 [Bug middle-end/43835] New: IPA-SRA doesn't rewrite attributes matz at gcc dot gnu dot org
2010-04-21 15:09 ` [Bug middle-end/43835] " matz at gcc dot gnu dot org
2010-04-21 15:52 ` [Bug middle-end/43835] [4.5 Regression] " rguenth at gcc dot gnu dot org
2010-04-21 16:04 ` jamborm at gcc dot gnu dot org
2010-04-22 17:30 ` jamborm at gcc dot gnu dot org
2010-04-23 14:43 ` jamborm at gcc dot gnu dot org
2010-04-23 16:16 ` jamborm at gcc dot gnu dot org
2010-04-23 16:20 ` jamborm 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).