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
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.
The warnings have now been removed from GCC (for 3.3) so can this be closed or should this stay open for that regression?
The warnings have been removed.