[llvm-commits] [llvm-gcc-4.2] r46201 - /llvm-gcc-4.2/trunk/gcc/ada/utils.c
Duncan Sands
baldrick at free.fr
Sun Jan 20 06:16:19 PST 2008
Author: baldrick
Date: Sun Jan 20 08:16:18 2008
New Revision: 46201
URL: http://llvm.org/viewvc/llvm-project?rev=46201&view=rev
Log:
In a qualified union, all fields are at the same
offset, and their decl_qualifier's must be examined
in order. Sorting them by offset is thus (a) not
needed, and (b) potentially harmful, since it may
reorder them.
Modified:
llvm-gcc-4.2/trunk/gcc/ada/utils.c
Modified: llvm-gcc-4.2/trunk/gcc/ada/utils.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/ada/utils.c?rev=46201&r1=46200&r2=46201&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/ada/utils.c (original)
+++ llvm-gcc-4.2/trunk/gcc/ada/utils.c Sun Jan 20 08:16:18 2008
@@ -735,7 +735,9 @@
for (i = 0, field = fieldlist; field; field = TREE_CHAIN (field), i++)
gnu_arr[i] = field;
- qsort (gnu_arr, len, sizeof (tree), compare_field_bitpos);
+ /* The order of fields in a qualified union does matter. */
+ if (code != QUAL_UNION_TYPE)
+ qsort (gnu_arr, len, sizeof (tree), compare_field_bitpos);
/* Put the fields in the list in order of increasing position, which
means we start from the end. */
More information about the llvm-commits
mailing list