This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
egcs, trunk 8/30 solaris2.5 control reaches end of non-void function
- To: egcs-bugs at cygnus dot com
- Subject: egcs, trunk 8/30 solaris2.5 control reaches end of non-void function
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Mon, 31 Aug 1998 10:55:48 -0400 (EDT)
- Cc: davem at dm dot cobaltmicro dot com
When compiling the trunk from 8/30 on solaris2.5, I get the
following warning:
> stage2/xgcc -Bstage2/ -DIN_GCC -DSVR4 -W -Wall -O2 -g -DHAVE_CONFIG_H
> -DHAIFA -I. -I. -I./config -c insn-output.c
> insn-output.c: In function `output_146':
> insn-output.c:328: warning: control reaches end of non-void function
I traced this to the definition of *movsf_const_intreg in
sparc.md. I've listed it below.
> (define_insn "*movsf_const_intreg"
> [(set (match_operand:SF 0 "general_operand" "=f,r")
> (match_operand:SF 1 "" "m,F"))]
> "TARGET_FPU
> && GET_CODE (operands[1]) == CONST_DOUBLE
> && GET_CODE (operands[0]) == REG"
> "*
> {
> REAL_VALUE_TYPE r;
> long i;
>
> if (which_alternative == 0)
> return \"ld\\t%1, %0\";
>
> REAL_VALUE_FROM_CONST_DOUBLE (r, operands[1]);
> REAL_VALUE_TO_TARGET_SINGLE (r, i);
> if (SPARC_SIMM13_P (i) || SPARC_SETHI_P (i))
> {
> operands[1] = GEN_INT (i);
> if (SPARC_SIMM13_P (INTVAL (operands[1])))
> return \"mov\\t%1, %0\";
> else if (SPARC_SETHI_P (INTVAL (operands[1]))) <<<---+
> return \"sethi\\t%%hi(%a1), %0\"; <<<--- this is the problem?
> }
> else
> return \"#\";
> }"
> [(set_attr "type" "move")
> (set_attr "length" "1")])
Given the logic, it does appear that one can fall off the end
inside the nested if's.
--Kaveh
--
Kaveh R. Ghazi Engagement Manager / Project Services
ghazi@caip.rutgers.edu Icon CMT Corp.