Bug 4280 - Misplaced warnings with optimized `foo / 0.0'
Summary: Misplaced warnings with optimized `foo / 0.0'
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 3.0.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2001-09-09 17:16 UTC by Hallvard B Furuseth
Modified: 2004-01-25 07:32 UTC (History)
2 users (show)

See Also:
Host: sparc-sun-solaris2.8
Target: sparc-sun-solaris2.8
Build: sparc-sun-solaris2.8
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hallvard B Furuseth 2001-09-09 17:16:00 UTC
	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.

Release:
3.0.1

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

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
Comment 1 Richard Henderson 2002-04-02 23:37:20 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Misplaced warnings produced under simplify_binary_real during
    cse_insn.  We don't have a way to pass down some notion of the
    current insn being considered here, so no way to get hold of 
    the proper line number.
Comment 2 Andrew Pinski 2003-11-16 03:37:11 UTC
The warnings have now been removed from GCC (for 3.3) so can this be closed or should this stay 
open for that regression?
Comment 3 Eric Botcazou 2004-01-25 07:32:38 UTC
The warnings have been removed.