This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

egcs, trunk 8/30 solaris2.5 control reaches end of non-void function


	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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]