+2008-04-15 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree-ssa-structalias.c (get_constraint_for_component_ref): Do not
+ punt for STRING_CST.
+ (get_constraint_for): Deal with STRING_CST here instead.
+
2008-04-15 Richard Guenther <rguenther@suse.de>
* tree-ssa-propagate.c (substitute_and_fold): Substitute
+2008-04-15 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/string_slice2.adb: New test.
+
2008-04-15 Richard Guenther <rguenther@suse.de>
* gcc.dg/fold-compare-2.c: Adjust testcase.
--- /dev/null
+-- { dg-do compile }
+-- { dg-options "-O" }
+
+with Ada.Strings;
+with Ada.Strings.Fixed;
+
+procedure String_Slice2 is
+
+ package ASF renames Ada.Strings.Fixed;
+
+ Delete_String : String(1..10);
+ Source_String2 : String(1..12) := "abcdefghijkl";
+
+begin
+
+ Delete_String := Source_String2(1..10);
+
+ ASF.Delete(Source => Delete_String,
+ From => 6,
+ Through => Delete_String'Last,
+ Justify => Ada.Strings.Left,
+ Pad => 'x');
+
+end;
t = get_ref_base_and_extent (t, &bitpos, &bitsize, &bitmaxsize);
- /* String constants are readonly, so there is nothing to really do
- here. */
- if (TREE_CODE (t) == STRING_CST)
- return;
-
get_constraint_for (t, results);
result = VEC_last (ce_s, *results);
result->offset = bitpos;
return;
}
+ /* String constants are read-only. */
+ if (TREE_CODE (t) == STRING_CST)
+ {
+ temp.var = readonly_id;
+ temp.type = SCALAR;
+ temp.offset = 0;
+ VEC_safe_push (ce_s, heap, *results, &temp);
+ return;
+ }
+
switch (TREE_CODE_CLASS (TREE_CODE (t)))
{
case tcc_expression: