Re: may_be_unaligned_p bug?

2010-04-10 Thread Eric Botcazou
> As a workaround, I had may_be_unaligned_p() return true if toffset is
> set, but there's likely times when that results in suboptimal code.

Wouldn't this be sufficient?

Index: tree-ssa-loop-ivopts.c
===
--- tree-ssa-loop-ivopts.c  (revision 158148)
+++ tree-ssa-loop-ivopts.c  (working copy)
@@ -1546,6 +1546,9 @@ may_be_unaligned_p (tree ref, tree step)
  || bitpos % BITS_PER_UNIT != 0)
return true;
 
+  if (toffset && !constant_multiple_of (toffset, al, &mul))
+   return true;
+
   if (!constant_multiple_of (step, al, &mul))
return true;
 }

-- 
Eric Botcazou


Re: dragonegg in FSF gcc?

2010-04-10 Thread Duncan Sands

Hi Basile,


I tend to be quite happy with the idea of dragonegg being a good GCC
plugin, since it is a good illustration of the plugin feature.


I think Jack wasn't suggesting that dragonegg should be changed to not be
a plugin any more.  I think he was suggesting that it should live in the gcc
repository rather than the LLVM repository.

Ciao,

Duncan.


Re: may_be_unaligned_p bug?

2010-04-10 Thread Eric Botcazou
> Index: tree-ssa-loop-ivopts.c
> ===
> --- tree-ssa-loop-ivopts.c(revision 158148)
> +++ tree-ssa-loop-ivopts.c(working copy)
> @@ -1546,6 +1546,9 @@ may_be_unaligned_p (tree ref, tree step)
>
> || bitpos % BITS_PER_UNIT != 0)
>
>   return true;
>
> +  if (toffset && !constant_multiple_of (toffset, al, &mul))
> + return true;
> +
>if (!constant_multiple_of (step, al, &mul))
>   return true;
>  }

constant_multiple_of is too restrictive though, something like:

Index: tree-ssa-loop-ivopts.c
===
--- tree-ssa-loop-ivopts.c  (revision 158148)
+++ tree-ssa-loop-ivopts.c  (working copy)
@@ -1537,16 +1537,18 @@ may_be_unaligned_p (tree ref, tree step)
 
   if (mode != BLKmode)
 {
-  double_int mul;
-  tree al = build_int_cst (TREE_TYPE (step),
-  GET_MODE_ALIGNMENT (mode) / BITS_PER_UNIT);
+  unsigned mode_align = GET_MODE_ALIGNMENT (mode);
 
-  if (base_align < GET_MODE_ALIGNMENT (mode)
- || bitpos % GET_MODE_ALIGNMENT (mode) != 0
- || bitpos % BITS_PER_UNIT != 0)
+  if (base_align < mode_align
+ || (bitpos % mode_align) != 0
+ || (bitpos % BITS_PER_UNIT) != 0)
return true;
 
-  if (!constant_multiple_of (step, al, &mul))
+  if (toffset
+ && (highest_pow2_factor (toffset) * BITS_PER_UNIT) < mode_align)
+   return true;
+
+  if ((highest_pow2_factor (step) * BITS_PER_UNIT) < mode_align)
return true;
 }
 
-- 
Eric Botcazou


Deprecation of -I- and -iquote

2010-04-10 Thread Rodolfo Lima
I wonder what's the current state of -I- vs. -iquote, is there anyone
interested in fixing the fact that -iquote doesn't replace -I-
functionality, needed for out-of-source precompiled header utilization?

The relevant bug is 19541 - need another option to support what -I- did
just besides -iquote, and there's a patch floating around that adds
-ignore-source-dir flag
(http://gcc.gnu.org/ml/gcc-patches/2007-03/msg00653.html). What else is
needed move this forward?

Regards,
Rodolfo Lima