public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67064] New: Register asm variable broken
@ 2015-07-30  6:41 sebastian.huber@embedded-brains.de
  2015-07-30  6:51 ` [Bug c++/67064] " sebastian.huber@embedded-brains.de
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: sebastian.huber@embedded-brains.de @ 2015-07-30  6:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67064

            Bug ID: 67064
           Summary: Register asm variable broken
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sebastian.huber@embedded-brains.de
  Target Milestone: ---

The following test case fails on x86_64-pc-linux-gnu, powerpc-rtems,
sparc-rtems:

struct s {
  int i;
};

register struct s *reg __asm__( "1" );

int f(void)
{
  int i;

  i = reg->i;
  i = (reg)->i;

  return i;
}

Yields:

prreg.cc:5:20: warning: call-clobbered register used for global register
variable
 register struct s *reg __asm__( "1" );
                    ^
prreg.cc: In function ‘int f()’:
prreg.cc:12:8: error: address of explicit register variable ‘reg’ requested
   i = (reg)->i;
        ^

Please note, that the line 11 "i = reg->i;" works.
>From gcc-bugs-return-493722-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jul 30 06:44:21 2015
Return-Path: <gcc-bugs-return-493722-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 28553 invoked by alias); 30 Jul 2015 06:44:21 -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 28406 invoked by uid 48); 30 Jul 2015 06:44:17 -0000
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67064] Register asm variable broken
Date: Thu, 30 Jul 2015 06:44:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pinskia at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
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:
Message-ID: <bug-67064-4-9eED7YfZKU@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67064-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67064-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: 2015-07/txt/msg02612.txt.bz2
Content-length: 224

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg064

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
C++11 rules about (x) have changed.  If you use -std=gnu++98 you would get the
same behavior as before.


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

end of thread, other threads:[~2015-10-20  6:49 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-30  6:41 [Bug c++/67064] New: Register asm variable broken sebastian.huber@embedded-brains.de
2015-07-30  6:51 ` [Bug c++/67064] " sebastian.huber@embedded-brains.de
2015-07-30  7:10 ` pinskia at gcc dot gnu.org
2015-07-30 14:31 ` hannes_weisbach at gmx dot net
2015-07-30 15:23 ` daniel.gutson at tallertechnologies dot com
2015-07-30 16:34 ` daniel.gutson at tallertechnologies dot com
2015-07-30 17:54 ` jens.maurer at gmx dot net
2015-07-30 18:27 ` daniel.gutson at tallertechnologies dot com
2015-07-30 18:47 ` jason at gcc dot gnu.org
2015-07-30 18:50 ` ville.voutilainen at gmail dot com
2015-07-30 18:52 ` daniel.gutson at tallertechnologies dot com
2015-07-30 19:08 ` ville.voutilainen at gmail dot com
2015-07-30 19:18 ` jason at gcc dot gnu.org
2015-07-31 14:53 ` daniel.gutson at tallertechnologies dot com
2015-07-31 20:24 ` jens.maurer at gmx dot net
2015-08-03 15:47 ` jason at gcc dot gnu.org
2015-08-03 18:43 ` daniel.gutson at tallertechnologies dot com
2015-08-03 18:53 ` manu at gcc dot gnu.org
2015-08-17 18:15 ` jason at gcc dot gnu.org
2015-08-17 18:28 ` daniel.gutson at tallertechnologies dot com
2015-08-17 18:55 ` jason at gcc dot gnu.org
2015-09-16 14:18 ` andres.tiraboschi at tallertechnologies dot com
2015-09-16 15:55 ` manu at gcc dot gnu.org
2015-10-20  6:49 ` jason at gcc dot gnu.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).