public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pthaugen at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/57756] Function target attribute is retaining  state of previously seen function
Date: Wed, 16 Oct 2013 16:54:00 -0000	[thread overview]
Message-ID: <bug-57756-4-JewzO98X7E@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-57756-4@http.gcc.gnu.org/bugzilla/>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 5240 bytes --]

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

Pat Haugen <pthaugen at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pthaugen at gcc dot gnu.org

--- Comment #3 from Pat Haugen <pthaugen at gcc dot gnu.org> ---
Revision 203634 broke PowerPC also with the following errors:

/home/pthaugen/src/gcc/trunk/gcc/gcc/config/rs6000/rs6000.c: At global scope:
/home/pthaugen/src/gcc/trunk/gcc/gcc/config/rs6000/rs6000.c:31122: error:
invalid conversion from ‘void (*)(cl_target_option*)’ to ‘void
(*)(cl_target_option*, gcc_options*)’
/home/pthaugen/src/gcc/trunk/gcc/gcc/config/rs6000/rs6000.c:31122: error:
invalid conversion from ‘void (*)(cl_target_option*)’ to ‘void
(*)(gcc_options*, cl_target_option*)’
>From gcc-bugs-return-431961-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Oct 16 17:06:32 2013
Return-Path: <gcc-bugs-return-431961-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 3784 invoked by alias); 16 Oct 2013 17:06:32 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 3761 invoked by uid 48); 16 Oct 2013 17:06:29 -0000
From: "adam at aphirst dot karoo.co.uk" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/58750] New: Allocate-on-assignment fails when using size(other_array) in the assignment statement
Date: Wed, 16 Oct 2013 17:06:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.8.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: adam at aphirst dot karoo.co.uk
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created
Message-ID: <bug-58750-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-10/txt/msg01105.txt.bz2
Content-length: 2470

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX750

            Bug ID: 58750
           Summary: Allocate-on-assignment fails when using
                    size(other_array) in the assignment statement
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: adam at aphirst dot karoo.co.uk

Created attachment 31019
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id1019&actioníit
The function to which I've isolated the problem

System: Arch Linux x86_64, GCC 4.8.1 20130725 (prerelease) from official repos
Compiler flags: -Wall -Wextra -stdò008 -s -march=native (no other
optimizations)

OK, so I have a function in which I'm putting some integers into allocatable
arrays using the F2008 allocate-on-assignment features. I've attached to this
bug report the specific function that goes sour, while the whole module file
can be found at http://pastebin.com/0ZVtVEzX , where the offending lines are
277-278.

I've been trying to construct a minimal demonstration of this problem without
much success, but I'll detail why I think this is a problem:

I'm allocating-on-assignment an array "primes" from the other functions in my
module, and if I print its contents or size(primes) I get the correct values.
So far so good.

What I'm then doing is creating an array full of zeros that's the same size as
"primes", called "powers". I'm doing this via:
powers = [ ( 0, i=1,size(primes) ) ]
and this is where the problem shows itself. If I then print powers I get a
blank line, and if I print size(powers) I get 0 . This of course causes the
rest of the function to be gibberish.

I also get the problem if I for instance have an integer "the_size" which I set
to size(primes). Despite being able to print "the_size" and get the correct
number, trying to allocate "powers" via
[ ( 0, i=1,the_size ) ]
gives the same problem.

If, however, I instead allocate "powers" using a literal, i.e.
powers = [ ( 0, i=1,10 ) ]
then the allocate-on-assign seems to work correctly.

Obviously I can also manually call allocate() then powers=0, but I shouldn't
_have_ to do that...

Is this enough information for someone to reproduce my problem, or understand
what the issue could be? Like I say, I've tried to create from-scratch
something to demonstrate the problem, but I can't coax the behaviour out.


  parent reply	other threads:[~2013-10-16 16:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-29  1:58 [Bug target/57756] New: " tmsriram at google dot com
2013-10-15 21:43 ` [Bug target/57756] " tmsriram at gcc dot gnu.org
2013-10-16 11:25 ` graham.stott at btinternet dot com
2013-10-16 16:54 ` pthaugen at gcc dot gnu.org [this message]
2013-10-16 23:06 ` meissner at gcc dot gnu.org
2013-11-14 13:19 ` ysrumyan at gmail dot com
2013-11-14 13:22 ` ysrumyan at gmail dot com
2013-11-15  9:11 ` ubizjak at gmail dot com
2013-11-15 14:23 ` ysrumyan at gmail dot com
2013-11-20 11:59 ` kyukhin 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-57756-4-JewzO98X7E@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).