public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Hallvard B Furuseth <h.b.furuseth@usit.uio.no>
To: gcc-gnats@gcc.gnu.org
Subject: optimization/4280: Misplaced warnings with optimized `foo / 0.0'
Date: Sun, 09 Sep 2001 17:16:00 -0000	[thread overview]
Message-ID: <E15gEh5-0007Zp-00@bombur.uio.no> (raw)

>Number:         4280
>Category:       optimization
>Synopsis:       Misplaced warnings with optimized `foo / 0.0'
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Sep 09 17:16:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Hallvard B Furuseth
>Release:        3.0.1
>Organization:
University of Oslo
>Environment:
System: SunOS bombur.uio.no 5.8 Generic_108528-03 sun4u sparc SUNW,Ultra-5_10
Architecture: sun4

	
host: sparc-sun-solaris2.8
build: sparc-sun-solaris2.8
target: sparc-sun-solaris2.8
configured with: ../gcc-3.0.1/configure --prefix=/usit/bombur/hbf --program-suffix=3 --enable-version-specific-runtime-libs --enable-languages=c --quiet
>Description:
	Warnings `division: NaN - producing operation'
	and `division: function singularity' form optimized code
	get the wrong line numbers.  (The line of the closing
	brace of the end of the function.)

	`gcc -W' produces some correctly placed warnings.

	`gcc -W -O' produces some additional misplaced warnings.
	The warnings which `gcc -W' also produced, are not misplaced.

>How-To-Repeat:
	$ cat a.c
double a, b, c, d, e, f;
void y()
{
  double zero = 0.0;

  /* Misplaced warnings: */
  a = zero / zero;	/* "line 15" NaN */
  b = 0.0  / zero;	/* "line 15" NaN */
  c = zero / 0.0;	/* "line 15" NaN */
  d = 1.0  / zero;	/* "line 15" singularity */

  /* Correctly placed warnings: */
  e = 0.0  / 0.0;	/* line 13  NaN */
  f = 1.0  / 0.0;	/* line 14 singularity */
}			/* line 15 */

/* Correctly placed warnings: */
double g = 0.0 / 0.0;	/* line 18 NaN */
double h = 1.0 / 0.0;	/* line 19 singularity */

	$ gcc3 -W -S a.c
a.c: In function `y':
a.c:13: warning: division: NaN - producing operation
a.c:14: warning: division: function singularity
a.c: At top level:
a.c:18: warning: division: NaN - producing operation
a.c:19: warning: division: function singularity

	$ gcc3 -W -O -S a.c
a.c: In function `y':
a.c:13: warning: division: NaN - producing operation
a.c:14: warning: division: function singularity
a.c:15: warning: division: NaN - producing operation
a.c:15: warning: division: NaN - producing operation
a.c:15: warning: division: NaN - producing operation
a.c:15: warning: division: function singularity
a.c: At top level:
a.c:18: warning: division: NaN - producing operation
a.c:19: warning: division: function singularity
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2001-09-09 17:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-09 17:16 Hallvard B Furuseth [this message]
2002-04-02 23:37 rth

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=E15gEh5-0007Zp-00@bombur.uio.no \
    --to=h.b.furuseth@usit.uio.no \
    --cc=gcc-gnats@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).