public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/40726]  New: [4.5 Regression] miscompilation at -O1
@ 2009-07-12 14:18 jv244 at cam dot ac dot uk
  2009-07-12 14:21 ` [Bug middle-end/40726] " jv244 at cam dot ac dot uk
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: jv244 at cam dot ac dot uk @ 2009-07-12 14:18 UTC (permalink / raw)
  To: gcc-bugs

CP2K is currently miscompiled by gcc trunk. The last know good version is rev. 
149159 first bad version is 149201. I've been able to narrow the problem down
to a miscompilation of 1 file, works fine at -O0, but goes wrong at -O1. I
don't have a runtime testcase (except running cp2k.sopt on
cp2k/tests/QS/H2O.inp), but the file to be attached (derived from
cp_linked_list_val.F) is maybe small & clear enough. I can also easily test a
number of compile time options.


-- 
           Summary: [4.5 Regression] miscompilation at -O1
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jv244 at cam dot ac dot uk


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


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

* [Bug middle-end/40726] [4.5 Regression] miscompilation at -O1
  2009-07-12 14:18 [Bug middle-end/40726] New: [4.5 Regression] miscompilation at -O1 jv244 at cam dot ac dot uk
@ 2009-07-12 14:21 ` jv244 at cam dot ac dot uk
  2009-07-12 14:22 ` jv244 at cam dot ac dot uk
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: jv244 at cam dot ac dot uk @ 2009-07-12 14:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jv244 at cam dot ac dot uk  2009-07-12 14:20 -------
Created an attachment (id=18180)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18180&action=view)
testcase

correct results with
gfortran -c -O0 PR40726.f90 
wrong code with
gfortran -c -O1 PR40726.f90


-- 


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


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

* [Bug middle-end/40726] [4.5 Regression] miscompilation at -O1
  2009-07-12 14:18 [Bug middle-end/40726] New: [4.5 Regression] miscompilation at -O1 jv244 at cam dot ac dot uk
  2009-07-12 14:21 ` [Bug middle-end/40726] " jv244 at cam dot ac dot uk
@ 2009-07-12 14:22 ` jv244 at cam dot ac dot uk
  2009-07-12 14:25 ` rguenth at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: jv244 at cam dot ac dot uk @ 2009-07-12 14:22 UTC (permalink / raw)
  To: gcc-bugs



-- 

jv244 at cam dot ac dot uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.5.0


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


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

* [Bug middle-end/40726] [4.5 Regression] miscompilation at -O1
  2009-07-12 14:18 [Bug middle-end/40726] New: [4.5 Regression] miscompilation at -O1 jv244 at cam dot ac dot uk
                   ` (2 preceding siblings ...)
  2009-07-12 14:25 ` rguenth at gcc dot gnu dot org
@ 2009-07-12 14:25 ` rguenth at gcc dot gnu dot org
  2009-07-12 14:30 ` jv244 at cam dot ac dot uk
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-07-12 14:25 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.5.0


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


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

* [Bug middle-end/40726] [4.5 Regression] miscompilation at -O1
  2009-07-12 14:18 [Bug middle-end/40726] New: [4.5 Regression] miscompilation at -O1 jv244 at cam dot ac dot uk
  2009-07-12 14:21 ` [Bug middle-end/40726] " jv244 at cam dot ac dot uk
  2009-07-12 14:22 ` jv244 at cam dot ac dot uk
@ 2009-07-12 14:25 ` rguenth at gcc dot gnu dot org
  2009-07-12 14:25 ` rguenth at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-07-12 14:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2009-07-12 14:24 -------
Do you by chance return pointers in any function?  In which case you should
try removing DECL_IS_MALLOC (fndecl) = 1 in trans-decl.c.  I pointed this out
to Paul already, but appearantly it is still stuck in his whole-file
patch queue.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.5.0                       |---


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


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

* [Bug middle-end/40726] [4.5 Regression] miscompilation at -O1
  2009-07-12 14:18 [Bug middle-end/40726] New: [4.5 Regression] miscompilation at -O1 jv244 at cam dot ac dot uk
                   ` (3 preceding siblings ...)
  2009-07-12 14:25 ` rguenth at gcc dot gnu dot org
@ 2009-07-12 14:30 ` jv244 at cam dot ac dot uk
  2009-07-12 14:31 ` rguenth at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: jv244 at cam dot ac dot uk @ 2009-07-12 14:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jv244 at cam dot ac dot uk  2009-07-12 14:30 -------
(In reply to comment #2)
> Do you by chance return pointers in any function?  In which case you should
> try removing DECL_IS_MALLOC (fndecl) = 1 in trans-decl.c.  I pointed this out
> to Paul already, but appearantly it is still stuck in his whole-file
> patch queue.
> 

yes, this happens here:

  FUNCTION cp_sll_val_get_first_el(sll,error) RESULT(res)
    TYPE(cp_sll_val_type), POINTER           :: sll
    TYPE(cp_error_type), INTENT(inout)       :: error
    TYPE(val_type), POINTER                  :: res

and in several other places, I'll see if I can remove the statement you
mention.


-- 


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


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

* [Bug middle-end/40726] [4.5 Regression] miscompilation at -O1
  2009-07-12 14:18 [Bug middle-end/40726] New: [4.5 Regression] miscompilation at -O1 jv244 at cam dot ac dot uk
                   ` (4 preceding siblings ...)
  2009-07-12 14:30 ` jv244 at cam dot ac dot uk
@ 2009-07-12 14:31 ` rguenth at gcc dot gnu dot org
  2009-07-12 14:35 ` jv244 at cam dot ac dot uk
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-07-12 14:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2009-07-12 14:30 -------
Instead, if the Fortran return type does not have POINTER, TARGET or
ALLOCATABLE
attributes the middle-end type for the result-decl should have TYPE_RESTRICT
set if it is a pointer.


-- 


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


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

* [Bug middle-end/40726] [4.5 Regression] miscompilation at -O1
  2009-07-12 14:18 [Bug middle-end/40726] New: [4.5 Regression] miscompilation at -O1 jv244 at cam dot ac dot uk
                   ` (5 preceding siblings ...)
  2009-07-12 14:31 ` rguenth at gcc dot gnu dot org
@ 2009-07-12 14:35 ` jv244 at cam dot ac dot uk
  2009-07-12 14:59 ` rguenth at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: jv244 at cam dot ac dot uk @ 2009-07-12 14:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jv244 at cam dot ac dot uk  2009-07-12 14:35 -------
>  In which case you should
> > try removing DECL_IS_MALLOC (fndecl) = 1 in trans-decl.c. 

this matches twice (line 1565 and line 1429). Which one should be removed ?


-- 


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


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

* [Bug middle-end/40726] [4.5 Regression] miscompilation at -O1
  2009-07-12 14:18 [Bug middle-end/40726] New: [4.5 Regression] miscompilation at -O1 jv244 at cam dot ac dot uk
                   ` (6 preceding siblings ...)
  2009-07-12 14:35 ` jv244 at cam dot ac dot uk
@ 2009-07-12 14:59 ` rguenth at gcc dot gnu dot org
  2009-07-12 15:07 ` jv244 at cam dot ac dot uk
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-07-12 14:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from rguenth at gcc dot gnu dot org  2009-07-12 14:58 -------
Both.


-- 


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


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

* [Bug middle-end/40726] [4.5 Regression] miscompilation at -O1
  2009-07-12 14:18 [Bug middle-end/40726] New: [4.5 Regression] miscompilation at -O1 jv244 at cam dot ac dot uk
                   ` (7 preceding siblings ...)
  2009-07-12 14:59 ` rguenth at gcc dot gnu dot org
@ 2009-07-12 15:07 ` jv244 at cam dot ac dot uk
  2009-07-15  7:43 ` [Bug fortran/40726] " burnus at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: jv244 at cam dot ac dot uk @ 2009-07-12 15:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jv244 at cam dot ac dot uk  2009-07-12 15:06 -------
(In reply to comment #6)
> Both.

This seems to fix the issue, indeed.


-- 


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


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

* [Bug fortran/40726] [4.5 Regression] miscompilation at -O1
  2009-07-12 14:18 [Bug middle-end/40726] New: [4.5 Regression] miscompilation at -O1 jv244 at cam dot ac dot uk
                   ` (8 preceding siblings ...)
  2009-07-12 15:07 ` jv244 at cam dot ac dot uk
@ 2009-07-15  7:43 ` burnus at gcc dot gnu dot org
  2009-07-15 15:32 ` jv244 at cam dot ac dot uk
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-07-15  7:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from burnus at gcc dot gnu dot org  2009-07-15 07:42 -------
> I pointed this out to Paul already, but appearantly it is still stuck in his 
> whole-file patch queue.

Last incarnation of that patch (containing this fix) is at:
  http://gcc.gnu.org/ml/fortran/2009-07/msg00105.html
Paul had another version which fixed several issues, but some last-minute
regressions were found...


-- 


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


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

* [Bug fortran/40726] [4.5 Regression] miscompilation at -O1
  2009-07-12 14:18 [Bug middle-end/40726] New: [4.5 Regression] miscompilation at -O1 jv244 at cam dot ac dot uk
                   ` (9 preceding siblings ...)
  2009-07-15  7:43 ` [Bug fortran/40726] " burnus at gcc dot gnu dot org
@ 2009-07-15 15:32 ` jv244 at cam dot ac dot uk
  2009-07-20  6:42 ` fxcoudert at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: jv244 at cam dot ac dot uk @ 2009-07-15 15:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jv244 at cam dot ac dot uk  2009-07-15 15:32 -------
(In reply to comment #8)
> > I pointed this out to Paul already, but appearantly it is still stuck in his 
> > whole-file patch queue.
> 
> Last incarnation of that patch (containing this fix) is at:
>   http://gcc.gnu.org/ml/fortran/2009-07/msg00105.html
> Paul had another version which fixed several issues, but some last-minute
> regressions were found...

maybe this part of the patch should be submitted separately, since it fixes an
issue that is independent of -fwhole-file?


-- 

jv244 at cam dot ac dot uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pault at gcc dot gnu dot org


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


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

* [Bug fortran/40726] [4.5 Regression] miscompilation at -O1
  2009-07-12 14:18 [Bug middle-end/40726] New: [4.5 Regression] miscompilation at -O1 jv244 at cam dot ac dot uk
                   ` (10 preceding siblings ...)
  2009-07-15 15:32 ` jv244 at cam dot ac dot uk
@ 2009-07-20  6:42 ` fxcoudert at gcc dot gnu dot org
  2009-07-20  7:29 ` pault at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2009-07-20  6:42 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |patch
      Known to fail|                            |4.5.0
      Known to work|                            |4.4.1
   Last reconfirmed|0000-00-00 00:00:00         |2009-07-20 06:42:19
               date|                            |


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


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

* [Bug fortran/40726] [4.5 Regression] miscompilation at -O1
  2009-07-12 14:18 [Bug middle-end/40726] New: [4.5 Regression] miscompilation at -O1 jv244 at cam dot ac dot uk
                   ` (11 preceding siblings ...)
  2009-07-20  6:42 ` fxcoudert at gcc dot gnu dot org
@ 2009-07-20  7:29 ` pault at gcc dot gnu dot org
  2009-07-21  4:52 ` pault at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: pault at gcc dot gnu dot org @ 2009-07-20  7:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from pault at gcc dot gnu dot org  2009-07-20 07:28 -------
(In reply to comment #9)
> (In reply to comment #8)
> > > I pointed this out to Paul already, but appearantly it is still stuck in his 
> > > whole-file patch queue.
> > 
> > Last incarnation of that patch (containing this fix) is at:
> >   http://gcc.gnu.org/ml/fortran/2009-07/msg00105.html
> > Paul had another version which fixed several issues, but some last-minute
> > regressions were found...
> 

I will apply this fix tonight - it is he first opportunity that I have had for
a week.

Cheers

Paul
> maybe this part of the patch should be submitted separately, since it fixes an
> issue that is independent of -fwhole-file?
> 


-- 


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


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

* [Bug fortran/40726] [4.5 Regression] miscompilation at -O1
  2009-07-12 14:18 [Bug middle-end/40726] New: [4.5 Regression] miscompilation at -O1 jv244 at cam dot ac dot uk
                   ` (12 preceding siblings ...)
  2009-07-20  7:29 ` pault at gcc dot gnu dot org
@ 2009-07-21  4:52 ` pault at gcc dot gnu dot org
  2009-07-21  6:50 ` jv244 at cam dot ac dot uk
  2009-07-22 18:13 ` pault at gcc dot gnu dot org
  15 siblings, 0 replies; 17+ messages in thread
From: pault at gcc dot gnu dot org @ 2009-07-21  4:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from pault at gcc dot gnu dot org  2009-07-21 04:51 -------
Subject: Bug 40726

Author: pault
Date: Tue Jul 21 04:51:30 2009
New Revision: 149846

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149846
Log:
2009-07-21  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/40726
        * trans-decl.c (gfc_get_extern_function_decl): Do not set
        DECL_IS_MALLOC for pointer valued functions.
        (build_function_decl): The same.


Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-decl.c


-- 


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


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

* [Bug fortran/40726] [4.5 Regression] miscompilation at -O1
  2009-07-12 14:18 [Bug middle-end/40726] New: [4.5 Regression] miscompilation at -O1 jv244 at cam dot ac dot uk
                   ` (13 preceding siblings ...)
  2009-07-21  4:52 ` pault at gcc dot gnu dot org
@ 2009-07-21  6:50 ` jv244 at cam dot ac dot uk
  2009-07-22 18:13 ` pault at gcc dot gnu dot org
  15 siblings, 0 replies; 17+ messages in thread
From: jv244 at cam dot ac dot uk @ 2009-07-21  6:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from jv244 at cam dot ac dot uk  2009-07-21 06:49 -------
I verified that this issue is now fixed on trunk.


-- 

jv244 at cam dot ac dot uk changed:

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


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


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

* [Bug fortran/40726] [4.5 Regression] miscompilation at -O1
  2009-07-12 14:18 [Bug middle-end/40726] New: [4.5 Regression] miscompilation at -O1 jv244 at cam dot ac dot uk
                   ` (14 preceding siblings ...)
  2009-07-21  6:50 ` jv244 at cam dot ac dot uk
@ 2009-07-22 18:13 ` pault at gcc dot gnu dot org
  15 siblings, 0 replies; 17+ messages in thread
From: pault at gcc dot gnu dot org @ 2009-07-22 18:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from pault at gcc dot gnu dot org  2009-07-22 18:12 -------
Subject: Bug 40726

Author: pault
Date: Wed Jul 22 18:12:35 2009
New Revision: 149952

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149952
Log:
2009-07-22  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/40796
        * trans-decl.c (generate_local_decl): Unreferenced result
        variables with allocatable components should be treated like
        INTENT_OUT dummy variables.

2009-07-21  Richard Guenther  <rguenther@suse.de>

        PR fortran/40726
        Change attribution to Richi.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-decl.c


-- 


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


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

end of thread, other threads:[~2009-07-22 18:13 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-12 14:18 [Bug middle-end/40726] New: [4.5 Regression] miscompilation at -O1 jv244 at cam dot ac dot uk
2009-07-12 14:21 ` [Bug middle-end/40726] " jv244 at cam dot ac dot uk
2009-07-12 14:22 ` jv244 at cam dot ac dot uk
2009-07-12 14:25 ` rguenth at gcc dot gnu dot org
2009-07-12 14:25 ` rguenth at gcc dot gnu dot org
2009-07-12 14:30 ` jv244 at cam dot ac dot uk
2009-07-12 14:31 ` rguenth at gcc dot gnu dot org
2009-07-12 14:35 ` jv244 at cam dot ac dot uk
2009-07-12 14:59 ` rguenth at gcc dot gnu dot org
2009-07-12 15:07 ` jv244 at cam dot ac dot uk
2009-07-15  7:43 ` [Bug fortran/40726] " burnus at gcc dot gnu dot org
2009-07-15 15:32 ` jv244 at cam dot ac dot uk
2009-07-20  6:42 ` fxcoudert at gcc dot gnu dot org
2009-07-20  7:29 ` pault at gcc dot gnu dot org
2009-07-21  4:52 ` pault at gcc dot gnu dot org
2009-07-21  6:50 ` jv244 at cam dot ac dot uk
2009-07-22 18:13 ` pault 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).