public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: middle-end/6950: gcc 3.0.4 miscompiles cppexp.c
@ 2002-12-03 14:50 bangerth
  0 siblings, 0 replies; 4+ messages in thread
From: bangerth @ 2002-12-03 14:50 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, jason, nobody

Synopsis: gcc 3.0.4 miscompiles cppexp.c

State-Changed-From-To: open->feedback
State-Changed-By: bangerth
State-Changed-When: Tue Dec  3 14:50:17 2002
State-Changed-Why:
    Jason, this was a bug report against 3.0.4, that you thought
    would be worth while fixing for 3.0.5. However, you note that
    it was in the trunk back then. Can you say what is the status
    for this, i.e. whether it should be closed or not?
    
    Thanks
      Wolfgang

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6950


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

* Re: middle-end/6950: gcc 3.0.4 miscompiles cppexp.c
@ 2002-12-04  6:26 bangerth
  0 siblings, 0 replies; 4+ messages in thread
From: bangerth @ 2002-12-04  6:26 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, jason, nobody

Synopsis: gcc 3.0.4 miscompiles cppexp.c

State-Changed-From-To: feedback->closed
State-Changed-By: bangerth
State-Changed-When: Wed Dec  4 06:26:22 2002
State-Changed-Why:
    Based on Jason's comment.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6950


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

* Re: middle-end/6950: gcc 3.0.4 miscompiles cppexp.c
@ 2002-12-03 22:46 Jason Merrill
  0 siblings, 0 replies; 4+ messages in thread
From: Jason Merrill @ 2002-12-03 22:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR middle-end/6950; it has been noted by GNATS.

From: Jason Merrill <jason@redhat.com>
To: bangerth@dealii.org
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: middle-end/6950: gcc 3.0.4 miscompiles cppexp.c
Date: Wed, 04 Dec 2002 01:27:51 -0500

 On 3 Dec 2002 22:50:19 -0000, bangerth@dealii.org wrote:
 
 > Jason, this was a bug report against 3.0.4, that you thought
 > would be worth while fixing for 3.0.5. However, you note that
 > it was in the trunk back then. Can you say what is the status
 > for this, i.e. whether it should be closed or not?
 
 It seems unlikely that there will be a 3.0.5, so I guess you might as well
 close it.
 
 Jason


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

* middle-end/6950: gcc 3.0.4 miscompiles cppexp.c
@ 2002-06-06 16:56 jason
  0 siblings, 0 replies; 4+ messages in thread
From: jason @ 2002-06-06 16:56 UTC (permalink / raw)
  To: gcc-gnats


>Number:         6950
>Category:       middle-end
>Synopsis:       gcc 3.0.4 miscompiles cppexp.c
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Thu Jun 06 16:56:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Jason Merrill
>Release:        3.0.4
>Organization:
Red Hat, Inc.
>Environment:
System: Linux prospero.cambridge.redhat.com 2.4.9-31 #1 Tue Feb 26 07:11:02 EST 2002 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /home/jason/eg/configure --with-gcc-version-trigger=/home/jason/eg/gcc/version.c --host=i686-pc-linux-gnu -v --with-dwarf2 --enable-threads=posix --with-as=/home/jason/s/sw/gas/as-new --with-ld=/home/jason/s/sw/ld/ld-new : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured)  : (reconfigured) 
>Description:
	In Neil's recent changes to cppexp.c, num_equality_op stores the
result of a && expression into a location which is used in the expression.
gcc 3.0.4 wrongly generates code for this which first stores 0 into the
target, then computes the expression, to poor result.

	This bug is not present in 2.95.3, Red Hat 2.96-98 or 3.1.0.  I
plan to work around this bug in the trunk sources, but it might still be a
good idea to fix this in a 3.0.5 release.

>How-To-Repeat:
Here is a reduced testcase.

  typedef struct cpp_num cpp_num;
  struct cpp_num
  {
    long high;
    long low;
    char overflow;
  };

  #define num_eq(num1, num2) (num1.low == num2.low && num1.high == num2.high)

  static cpp_num
  num_equality_op (lhs, rhs)
       cpp_num lhs, rhs;
  {
    lhs.low = num_eq (lhs, rhs);
    lhs.high = 0;
    lhs.overflow = 0;
    return lhs;
  }

  int main()
  {
    cpp_num a = { 1, 2 };
    cpp_num b = { 3, 4 };

    cpp_num result = num_equality_op (a, b);
    if (result.low)
      return 1;

    result = num_equality_op (a, a);
    if (!result.low)
      return 2;

    return 0;
  }

>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2002-12-04 14:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-03 14:50 middle-end/6950: gcc 3.0.4 miscompiles cppexp.c bangerth
  -- strict thread matches above, loose matches on Subject: below --
2002-12-04  6:26 bangerth
2002-12-03 22:46 Jason Merrill
2002-06-06 16:56 jason

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