OSDN Git Service

* approved by rth
[pf3gnuchains/gcc-fork.git] / gcc / ada / exp_fixd.adb
index 0eba7e2..0817f50 100644 (file)
@@ -6,7 +6,6 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---                            $Revision$
 --                                                                          --
 --          Copyright (C) 1992-2001 Free Software Foundation, Inc.          --
 --                                                                          --
@@ -1960,6 +1959,13 @@ package body Exp_Fixd is
       Right : constant Node_Id := Right_Opnd (N);
 
    begin
+      --  Suppress expansion of a fixed-by-fixed division if the
+      --  operation is supported directly by the target.
+
+      if Target_Has_Fixed_Ops (Etype (Left), Etype (Right), Etype (N)) then
+         return;
+      end if;
+
       if Etype (Left) = Universal_Real then
          Do_Divide_Universal_Fixed (N);
 
@@ -2100,6 +2106,13 @@ package body Exp_Fixd is
       end Rewrite_Non_Static_Universal;
 
    begin
+      --  Suppress expansion of a fixed-by-fixed multiplication if the
+      --  operation is supported directly by the target.
+
+      if Target_Has_Fixed_Ops (Etype (Left), Etype (Right), Etype (N)) then
+         return;
+      end if;
+
       if Etype (Left) = Universal_Real then
          if Nkind (Left) = N_Real_Literal then
             Do_Multiply_Fixed_Universal (N, Right, Left);