public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/11427] New: Problem with conditional expressions as l-values
@ 2003-07-03 19:33 bonet at cs dot ucla dot edu
  2003-07-05 17:07 ` [Bug c/11427] " kazu at cs dot umass dot edu
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: bonet at cs dot ucla dot edu @ 2003-07-03 19:33 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: Problem with conditional expressions as l-values
           Product: gcc
           Version: 3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bonet at cs dot ucla dot edu
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: SPARC/SOLARIS/5.8
  GCC host triplet: SPARC/SOLARIS/5.8
GCC target triplet: SPARC/SOLARIS/5.8

The program below compiles fine with gcc-2.95.3
but it does not compiles with gcc-3.2, producing
the error message:

p.c: In function `main':
p.c:14: invalid lvalue in assignment

The version of gcc I am using is (as reported with -v):

Reading specs from /net/peking/caracas/usr/local/bin/../lib/gcc-lib/sparc-sun-s
olaris2.9/3.2/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as 
--with-ld=/usr/ccs/bin/ld --disable-nls
Thread model: posix
gcc version 3.2

------- p.c ---------

#define PAIR(x,y)  ((x)<=(y) ? H2Cost[(x)][(y)-(x)] : H2Cost[(y)][(x)-(y)])

struct cost_s
{
  unsigned long plus;
  unsigned long max;
} cost_s;
typedef struct cost_s cost_t;

main()
{
  int p,q;
  cost_t **H2Cost;
  PAIR(p,q).max = 0;
}


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

* [Bug c/11427] Problem with conditional expressions as l-values
  2003-07-03 19:33 [Bug c/11427] New: Problem with conditional expressions as l-values bonet at cs dot ucla dot edu
@ 2003-07-05 17:07 ` kazu at cs dot umass dot edu
  2003-07-06  1:20 ` dhazeghi at yahoo dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: kazu at cs dot umass dot edu @ 2003-07-05 17:07 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


kazu at cs dot umass dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kazu at cs dot umass dot edu


------- Additional Comments From kazu at cs dot umass dot edu  2003-07-05 17:07 -------
Confirmed with mainline 2003-07-05 13:00GMT i686-pc-linux-gnu

struct s {
  int m;
};

void
foo (struct s *p, int a)
{
  (0 <= a ? p[a] : p[-a]).m = 0;
}


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

* [Bug c/11427] Problem with conditional expressions as l-values
  2003-07-03 19:33 [Bug c/11427] New: Problem with conditional expressions as l-values bonet at cs dot ucla dot edu
  2003-07-05 17:07 ` [Bug c/11427] " kazu at cs dot umass dot edu
@ 2003-07-06  1:20 ` dhazeghi at yahoo dot com
  2003-07-06  1:21 ` pinskia at physics dot uc dot edu
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-07-06  1:20 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


dhazeghi at yahoo dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
  GCC build triplet|SPARC/SOLARIS/5.8           |
   GCC host triplet|SPARC/SOLARIS/5.8           |
 GCC target triplet|SPARC/SOLARIS/5.8           |
           Keywords|                            |rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2003-07-06 01:20:08
               date|                            |


------- Additional Comments From dhazeghi at yahoo dot com  2003-07-06 01:20 -------
Confirmed with 3.3 branch (20030705) too. Kazu, when you confirm bugs, you can change them 
to NEW from UNCONFIRMED.


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

* [Bug c/11427] Problem with conditional expressions as l-values
  2003-07-03 19:33 [Bug c/11427] New: Problem with conditional expressions as l-values bonet at cs dot ucla dot edu
  2003-07-05 17:07 ` [Bug c/11427] " kazu at cs dot umass dot edu
  2003-07-06  1:20 ` dhazeghi at yahoo dot com
@ 2003-07-06  1:21 ` pinskia at physics dot uc dot edu
  2003-07-06  1:33 ` falk dot hueffner at student dot uni-tuebingen dot de
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-06  1:21 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-06 01:21 -------
I can add that using the c++ front end the code is accepted.


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

* [Bug c/11427] Problem with conditional expressions as l-values
  2003-07-03 19:33 [Bug c/11427] New: Problem with conditional expressions as l-values bonet at cs dot ucla dot edu
                   ` (2 preceding siblings ...)
  2003-07-06  1:21 ` pinskia at physics dot uc dot edu
@ 2003-07-06  1:33 ` falk dot hueffner at student dot uni-tuebingen dot de
  2003-07-06  1:53 ` jsm at polyomino dot org dot uk
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: falk dot hueffner at student dot uni-tuebingen dot de @ 2003-07-06  1:33 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From falk dot hueffner at student dot uni-tuebingen dot de  2003-07-06 01:33 -------
Subject: Re:  Problem with conditional expressions as l-values

Maybe we should go the easy way and deprecate it along with casts as
lvalues, since it seems like a pretty useless extension. (It's not an
extension in C++, though.)


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

* [Bug c/11427] Problem with conditional expressions as l-values
  2003-07-03 19:33 [Bug c/11427] New: Problem with conditional expressions as l-values bonet at cs dot ucla dot edu
                   ` (3 preceding siblings ...)
  2003-07-06  1:33 ` falk dot hueffner at student dot uni-tuebingen dot de
@ 2003-07-06  1:53 ` jsm at polyomino dot org dot uk
  2003-08-24 20:07 ` neroden at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jsm at polyomino dot org dot uk @ 2003-07-06  1:53 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From jsm at polyomino dot org dot uk  2003-07-06 01:53 -------
Subject: Re:  Problem with conditional expressions as l-values

On Sun, 6 Jul 2003, falk dot hueffner at student dot uni-tuebingen dot de wrote:

> Maybe we should go the easy way and deprecate it along with casts as
> lvalues, since it seems like a pretty useless extension. (It's not an
> extension in C++, though.)

I'll agree with deprecating all the extended lvalues - including ones such
as this that are valid in C++ - rather than fixing this case of the
extension, whether or not it turns out that the patch introducing this
problem was my C99 non-lvalue arrays patch
<http://gcc.gnu.org/ml/gcc-patches/2001-11/msg00319.html> (just a guess,
that patch removed an "optimization" that passed component references
inside conditional expressions, in order to get correctness for standard
code).


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

* [Bug c/11427] Problem with conditional expressions as l-values
  2003-07-03 19:33 [Bug c/11427] New: Problem with conditional expressions as l-values bonet at cs dot ucla dot edu
                   ` (4 preceding siblings ...)
  2003-07-06  1:53 ` jsm at polyomino dot org dot uk
@ 2003-08-24 20:07 ` neroden at gcc dot gnu dot org
  2003-11-05  4:25 ` pinskia at gcc dot gnu dot org
  2003-11-09  2:12 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: neroden at gcc dot gnu dot org @ 2003-08-24 20:07 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


neroden at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4                         |---


------- Additional Comments From neroden at gcc dot gnu dot org  2003-08-24 20:07 -------
This is a problem with using a GCC extension.  It would be nice if the lvalue extensions were eliminated, but it looks like it won't happen for 3.4. 
 Retargeting.


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

* [Bug c/11427] Problem with conditional expressions as l-values
  2003-07-03 19:33 [Bug c/11427] New: Problem with conditional expressions as l-values bonet at cs dot ucla dot edu
                   ` (5 preceding siblings ...)
  2003-08-24 20:07 ` neroden at gcc dot gnu dot org
@ 2003-11-05  4:25 ` pinskia at gcc dot gnu dot org
  2003-11-09  2:12 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-05  4:25 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2003-11-03 04:13:40         |2003-11-05 04:25:15
               date|                            |


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-11-05 04:25 -------
Patch to Deprecate this extension: <http://gcc.gnu.org/ml/gcc-patches/2003-11/
msg00262.html> but will not emlimate it fully though.


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

* [Bug c/11427] Problem with conditional expressions as l-values
  2003-07-03 19:33 [Bug c/11427] New: Problem with conditional expressions as l-values bonet at cs dot ucla dot edu
                   ` (6 preceding siblings ...)
  2003-11-05  4:25 ` pinskia at gcc dot gnu dot org
@ 2003-11-09  2:12 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-09  2:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-11-09 02:12 -------
Closing as will not fix as the extension is Deprecate for 3.4 and will be removed in a 
future version.

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


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


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

end of thread, other threads:[~2003-11-09  2:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-03 19:33 [Bug c/11427] New: Problem with conditional expressions as l-values bonet at cs dot ucla dot edu
2003-07-05 17:07 ` [Bug c/11427] " kazu at cs dot umass dot edu
2003-07-06  1:20 ` dhazeghi at yahoo dot com
2003-07-06  1:21 ` pinskia at physics dot uc dot edu
2003-07-06  1:33 ` falk dot hueffner at student dot uni-tuebingen dot de
2003-07-06  1:53 ` jsm at polyomino dot org dot uk
2003-08-24 20:07 ` neroden at gcc dot gnu dot org
2003-11-05  4:25 ` pinskia at gcc dot gnu dot org
2003-11-09  2:12 ` pinskia 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).