This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/17548] New: -march=pentium4 slows down Ada code
- From: "berndtrog at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Sep 2004 10:00:37 -0000
- Subject: [Bug ada/17548] New: -march=pentium4 slows down Ada code
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
$ gnatmake -f -O2 -march=pentium3 p4_ds_test
gcc -c -O2 -march=pentium3 p4_ds_test.adb
gnatbind -x p4_ds_test.ali
gnatlink p4_ds_test.ali -march=pentium3
$ time ./p4_ds_test
real 0m1.671s
user 0m1.580s
sys 0m0.070s
$ gnatmake -f -O2 -march=pentium4 p4_ds_test
gcc -c -O2 -march=pentium4 p4_ds_test.adb
gnatbind -x p4_ds_test.ali
gnatlink p4_ds_test.ali -march=pentium4
$ time ./p4_ds_test
real 0m4.395s
user 0m3.710s
sys 0m0.620s
-------------p4_ds_test.adb----------------------------------------
procedure P4_DS_Test
is
type Enumeration is (Ident_1, Ident_2, Ident_3);
type Record_Type (Discr: Enumeration := Ident_1);
type Record_Pointer is access Record_Type;
type Record_Type (Discr: Enumeration := Ident_1) is
record
Pointer_Comp: Record_Pointer;
case Discr is
when Ident_1 =>
Enum_Comp : Enumeration;
when others =>
null;
end case;
end record;
type Record_Type_x is
record
Pointer_Comp : Record_Pointer;
end record;
Pointer_Glob, Pointer_Glob_Next: Record_Pointer;
procedure Proc_1 (Pointer_Par_In: in Record_Pointer)
is
Next_Record : Record_Type
renames Pointer_Par_In.Pointer_Comp.all;
begin
Next_Record := Pointer_Glob.all;
end Proc_1;
begin
Pointer_Glob_Next := new Record_Type;
Pointer_Glob := new Record_Type
'(
Pointer_Comp => Pointer_Glob_Next,
Discr => Ident_1,
Enum_Comp => Ident_3
);
for Run_Index in 1 .. 20000000 Loop
Proc_1 (Pointer_Glob);
end loop;
end P4_DS_Test;
-------------------------------------------------------------
gcc 3.4.2
hw: P4 512k Northwood
Note: 3.3.2 does not show this kind of behavior ...
--
Summary: -march=pentium4 slows down Ada code
Product: gcc
Version: 3.4.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: ada
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: berndtrog at yahoo dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17548