This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: Update i686 peepholers and splitters for RTL profile


> Bootstrapped/regtested i686-linux, certainly hope for no major breakage
> this time... It is quite demanding to hand check all uses of the
> optimize_size in i386 backend :(

Ada is broken on i586-linux though:
 
though/home/eric/build/gcc/native32/./gcc/xgcc -B/home/eric/build/gcc/native32/./gcc/ -B/home/eric/install/gcc/i586-suse-linux/bin/ -B/home/eric/install/gcc/i586-suse-linux/lib/ -isystem /home/eric/install/gcc/i586-suse-linux/include -isystem /home/eric/install/gcc/i586-suse-linux/sys-include -c -g -O2 -fPIC  -W -Wall -gnatpg  
a-nllcef.ads -o a-nllcef.o
a-ngcefu.adb: In 
function 'Ada.Numerics.Long_Long_Complex_Elementary_Functions.Log':
a-ngcefu.adb:538: error: insn does not satisfy its constraints:
(insn 421 236 239 18 a-ngcefu.adb:528 (set (reg:XF 9 st(1) [143])
        (const_double:XF -1317922825 [0xb17217f7] 
6.93147180559945309428690474184975300886435434222e-1 
[0x0.b17217f7d1cf79acp+0])) 76 {*movxf_integer} (nil))
+===========================GNAT BUG DETECTED==============================+
| 4.4.0 20080812 (experimental) [trunk revision 138985] (i586-suse-linux-gnu) 
GCC error:|
| in copyprop_hardreg_forward_1, at regrename.c:1589                       |
| Error detected around a-ngcefu.adb:538                       :

Testcase attached, compile p.adb with -gnatp -O -mtune=i586.


The FP splitter rematerializes the constant in

(insn 58 56 59 12 p.adb:19 (set (reg:XF 9 st(1) [78])
        (mem/u/c/i:XF (symbol_ref/u:SI ("*.LC26") [flags 0x2]) [0 S12 A128])) 
76 {*movxf_integer} (expr_list:REG_EQUIV (const_double:XF -1317922825 
[0xb17217f7] 6.93147180559945309428690474184975300886435434222e-1 
[0x0.b17217f7d1cf79acp+0])
        (nil)))

because standard_80387_constant_p returns true since optimize_insn_for_size_p 
also returns true.  But optimize_size is false so movxf_integer rejects the 
new pattern.

Note that standard_80387_constant_p was changed as part of

2008-07-29  Jan Hubicka  <jh@suse.cz>

	* predict.c (always_optimize_for_size_p): New function.
	(optimize_bb_for_size_p, optimize_bb_for_speed_p,
	optimize_edge_for_size_p, optimize_edge_for_speed_p,
	optimize_insn_for_size_p, optimize_insn_for_speed_p): New global
	functions.
	(rtl_profile_for_bb, rtl_profile_for_edge, rtl_default_profile): New.
	* function.c (prepare_function_start): Set default profile.
	* function.h (rtl_data): Add maybe_hot_insn_p.
	* cfgexpand.c (expand_gimple_basic_block): Set RTL profile.
	(construct_exit_block): Likewise.
	(tree_expand_cfg): Likewise.
	* basic-block.h
	(optimize_bb_for_size_p, optimize_bb_for_speed_p,
	optimize_edge_for_size_p, optimize_edge_for_speed_p,
	optimize_insn_for_size_p, optimize_insn_for_speed_p): Declare.
	(rtl_profile_for_bb, rtl_profile_for_edge, default_rtl_profile):
	Declare.

but the change is not mentioned in the ChangeLog.  Is it bogus?  Same for 
another change to decide_alg in the same commit.

-- 
Eric Botcazou
package Q is

  type Real is new Long_Long_Float;

   type Complex is record
      Re, Im : Real'Base;
   end record;
   pragma Complex_Representation (Complex);

   function Re (X : Complex)   return Real'Base;
   function Im (X : Complex)   return Real'Base;

   function Compose_From_Cartesian (Re, Im : Real'Base) return Complex;

   function Modulus (X     : Complex) return Real'Base;

   function "/"       (Left : Complex;   Right : Real'Base) return Complex;

   function "*"       (Left, Right : Complex) return Complex;

end Q;
with Ada.Numerics.Generic_Elementary_Functions;

package body P is

   package Elementary_Functions is new
      Ada.Numerics.Generic_Elementary_Functions (Real'Base);
   use Elementary_Functions;

   Log_Two : constant := 0.69314_71805_59945_30941_72321_21458_17656_80755;

   function Log (X : Complex) return Complex is
      ReX : Real'Base;
      ImX : Real'Base;
   begin
      begin
         ReX := Log (Modulus (X));
      exception
         when Constraint_Error =>
            ReX := Log (Modulus (X / 2.0)) - Log_Two;
      end;

      ImX := Arctan (Im (X), Re (X));

      return Compose_From_Cartesian (ReX, ImX);
   end Log;

end P;
with Q; use Q;

package P is

   function Log (X : Complex) return Complex;

end P;

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