This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/16521] New: [H8/300 Target] Warning:"Will never be executed " with -O2 option
- From: "harshadk at kpitcummins dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jul 2004 13:51:25 -0000
- Subject: [Bug tree-optimization/16521] New: [H8/300 Target] Warning:"Will never be executed " with -O2 option
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Hi,
Consider the following test case for H8 target,with optimization option -O2 -
Wunreachable-code command line
gives warning "will never be executed".
It works fine if the Factorial function variable "Val" is of int type.
Also if the Factorial function variable "Val" is declared as volatile float
then it is working fine.
---------------- test.c--------------
float foo (float X)
{
float val = 1.0;
int k,j;
for (k=1; k < 5; k++)
{
val += 1.0;
}
return (val);
}---------------- test.c--------------
command line used:
h8300-elf-gcc -O2 -Wunreachable-code -S test.c
Observation :
-------------
test.c: In function 'foo':
test.c:11: warning: will never be executed
"This bug is not observed in GCC 3.5-20040627 snapshot but observed in GCC 3.4-
20040503 snapshot."
Regards,
Harshad Kulkarni
KPIT Cummins InfoSystems Ltd.
Pune, India
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNU based tool-chains for Renesas' SH and H8 Series.
The following site also offers free technical support to its users.
Visit http://www.kpitgnutools.com for details.
Latest versions of KPIT GNU tools were released on June 1, 2004.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
Summary: [H8/300 Target] Warning:"Will never be executed " with
-O2 option
Product: gcc
Version: 3.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: harshadk at kpitcummins dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: h8300-unknown-elf
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16521