public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/1833
@ 2003-05-08 23:46 Wolfgang Bangerth
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Bangerth @ 2003-05-08 23:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/1833; it has been noted by GNATS.

From: Wolfgang Bangerth <bangerth@ices.utexas.edu>
To: gcc-gnats@gcc.gnu.org, Giovanni Bajo <giovannibajo@libero.it>
Cc:  
Subject: Re: c++/1833
Date: Thu, 8 May 2003 18:38:11 -0500 (CDT)

 This is a gcc extension: cast-as-lvalue. I personally think it's an evil 
 one.
 
 Binding it to a reference yields all sorts of problems. I closed several 
 duplicates of some such bug recently. Giovanni, check 1920 and 7884, 
 possibly also 7503.
 
 W.
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:            bangerth@ices.utexas.edu
                                www: http://www.ices.utexas.edu/~bangerth/
 
 


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

* Re: c++/1833
@ 2003-05-09  7:16 Gabriel Dos Reis
  0 siblings, 0 replies; 5+ messages in thread
From: Gabriel Dos Reis @ 2003-05-09  7:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/1833; it has been noted by GNATS.

From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: Wolfgang Bangerth <bangerth@ices.utexas.edu>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/1833
Date: 09 May 2003 09:05:35 +0200

 Wolfgang Bangerth <bangerth@ices.utexas.edu> writes:
 
 | The following reply was made to PR c++/1833; it has been noted by GNATS.
 | 
 | From: Wolfgang Bangerth <bangerth@ices.utexas.edu>
 | To: gcc-gnats@gcc.gnu.org, Giovanni Bajo <giovannibajo@libero.it>
 | Cc:  
 | Subject: Re: c++/1833
 | Date: Thu, 8 May 2003 18:38:11 -0500 (CDT)
 | 
 |  This is a gcc extension: cast-as-lvalue. I personally think it's an evil 
 |  one.
 
 It should be removed.
 
 -- Gaby


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

* Re: c++/1833
@ 2003-04-04  3:06 Nigel Stewart
  0 siblings, 0 replies; 5+ messages in thread
From: Nigel Stewart @ 2003-04-04  3:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/1833; it has been noted by GNATS.

From: Nigel Stewart <nigels@nigels.com>
To: Wolfgang Bangerth <bangerth@ices.utexas.edu>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/1833
Date: Fri, 04 Apr 2003 12:58:54 +1000

 Wolfgang,
 
 Heeding your advice about aliasing rules, I've replaced
 the cast with a union.  Problem is solved.  However, I
 would suggest that gcc should provide warnings or errors
 in the case of being fed illegal code.
 
 float foo()
 {
 	assert(sizeof(unsigned int)==sizeof(float));
 	union { float f; unsigned int i; } tmp;
 	tmp.i = (127<<23) | (1<<22);
 	return tmp.f;
 }
 
 Thanks for your response, and my apologies for cluttering
 the bug database...
 
 N Stewart
 
 > Nigel,
 > the problem you sent has nothing to do with the problem described in PR 
 > 1833. You are violating aliasing rules. The code in the report is legal, 
 > yours is not.
 > 
 > W.
 


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

* Re: c++/1833
@ 2003-04-03 17:36 Wolfgang Bangerth
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Bangerth @ 2003-04-03 17:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/1833; it has been noted by GNATS.

From: Wolfgang Bangerth <bangerth@ices.utexas.edu>
To: gcc-gnats@gcc.gnu.org, <nigels@nigels.com>
Cc:  
Subject: Re: c++/1833
Date: Thu, 3 Apr 2003 11:31:58 -0600 (CST)

 Nigel,
 the problem you sent has nothing to do with the problem described in PR 
 1833. You are violating aliasing rules. The code in the report is legal, 
 yours is not.
 
 W.
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:            bangerth@ices.utexas.edu
                                www: http://www.ices.utexas.edu/~bangerth/
 
 


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

* Re: c++/1833
@ 2001-04-01  0:00 aoliva
  0 siblings, 0 replies; 5+ messages in thread
From: aoliva @ 2001-04-01  0:00 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/1833; it has been noted by GNATS.

From: aoliva@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org, peteb@sitera.com
Cc:  
Subject: Re: c++/1833
Date: 2 Mar 2001 10:26:28 -0000

 Synopsis: inlining sometimes causes incorrect behavior
 
 State-Changed-From-To: open->analyzed
 State-Changed-By: aoliva
 State-Changed-When: Fri Mar  2 02:26:28 2001
 State-Changed-Why:
     There is indeed a bug.  The problem is that the result of the cast is an rvalue, because the cast-to type is not a reference type.  Therefore, a temporary should be created.  However, a temporary cannot be bound to a non-const reference, but g++ happily binds it to frob2's argument, even with -ansi -pedantic.
     Even if the binding-to-non-const were to be done as an extension, it still shouldn't modify variable s; it should modify the temporary, then discard it.
     WRT the difference between the inline and the non-inline functions, the problem is likely to be in the tree level, because the initial RTL dump is already significantly different for the two functions.
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=1833&database=gcc


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

end of thread, other threads:[~2003-05-09  7:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-08 23:46 c++/1833 Wolfgang Bangerth
  -- strict thread matches above, loose matches on Subject: below --
2003-05-09  7:16 c++/1833 Gabriel Dos Reis
2003-04-04  3:06 c++/1833 Nigel Stewart
2003-04-03 17:36 c++/1833 Wolfgang Bangerth
2001-04-01  0:00 c++/1833 aoliva

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).