[Bug rtl-optimization/35281] [4.3/4.4 Regression] multiply with 0 generated for 64*32-64

2008-04-02 Thread bonzini at gnu dot org


--- Comment #14 from bonzini at gnu dot org  2008-04-02 09:57 ---
committed to trunk as 133828


-- 

bonzini at gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35281



[Bug rtl-optimization/35281] [4.3/4.4 Regression] multiply with 0 generated for 64*32-64

2008-03-11 Thread bonzini at gcc dot gnu dot org


--- Comment #12 from bonzini at gnu dot org  2008-03-11 16:49 ---
For 4.4, both mul16 and mul32 will be fixed by the pending patch.

The pending patch is what cures the regression part of this bug.


--- Comment #13 from bonzini at gnu dot org  2008-03-11 16:49 ---
Subject: Bug 35281

Author: bonzini
Date: Tue Mar 11 16:48:28 2008
New Revision: 133116

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=133116
Log:
2008-03-11  Paolo Bonzini  [EMAIL PROTECTED]

PR rtl-optimization/35281
* expr.c (convert_move): Use a new pseudo for the intermediate
from_mode-word_mode result.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/expr.c


-- 

bonzini at gnu dot org changed:

   What|Removed |Added

   Keywords||patch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35281



[Bug rtl-optimization/35281] [4.3/4.4 Regression] multiply with 0 generated for 64*32-64

2008-03-11 Thread bonzini at gnu dot org


--- Comment #12 from bonzini at gnu dot org  2008-03-11 16:49 ---
For 4.4, both mul16 and mul32 will be fixed by the pending patch.

The pending patch is what cures the regression part of this bug.


-- 

bonzini at gnu dot org changed:

   What|Removed |Added

   Keywords||patch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35281



[Bug rtl-optimization/35281] [4.3/4.4 Regression] multiply with 0 generated for 64*32-64

2008-03-10 Thread bonzini at gnu dot org


--- Comment #10 from bonzini at gnu dot org  2008-03-10 14:14 ---
I have a patch.


-- 

bonzini at gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |bonzini at gnu dot org
   |dot org |
 Status|NEW |ASSIGNED
   Last reconfirmed|2008-03-05 10:14:59 |2008-03-10 14:14:30
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35281



[Bug rtl-optimization/35281] [4.3/4.4 Regression] multiply with 0 generated for 64*32-64

2008-03-10 Thread bonzini at gnu dot org


--- Comment #11 from bonzini at gnu dot org  2008-03-10 15:19 ---
The patch at http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00623.html fixes
mul16.


-- 

bonzini at gnu dot org changed:

   What|Removed |Added

URL||http://gcc.gnu.org/ml/gcc-
   ||patches/2008-
   ||03/msg00624.html


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35281



[Bug rtl-optimization/35281] [4.3/4.4 Regression] multiply with 0 generated for 64*32-64

2008-03-05 Thread rguenth at gcc dot gnu dot org


--- Comment #5 from rguenth at gcc dot gnu dot org  2008-03-05 10:27 ---
With -O we even have

movl$0, %edx
movla, %ecx
imull   %edx, %ecx

I wonder why we do not constant-propagate / simplify here?

Note that with 4.2 and 4.1 mul16 is also bad.  Setting milestone to 4.3.1,
only mul32 is a regression.

Steven, shouldn't rtl const-prop catch this?


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||stevenb dot gcc at gmail dot
   ||com
  GCC build triplet|i386-apple-darwin9.2.0  |
   GCC host triplet|i386-apple-darwin9.2.0  |
 GCC target triplet|i386-apple-darwin9.2.0  |i?86-*-*
   Keywords||missed-optimization
   Priority|P3  |P2
Summary|[4.3 regression] multiply   |[4.3/4.4 Regression]
   |with 0 generated for 64*32- |multiply with 0 generated
   |64 |for 64*32-64
   Target Milestone|4.3.0   |4.3.1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35281



[Bug rtl-optimization/35281] [4.3/4.4 Regression] multiply with 0 generated for 64*32-64

2008-03-05 Thread ubizjak at gmail dot com


--- Comment #6 from ubizjak at gmail dot com  2008-03-05 10:32 ---
4.2 figures out in cse1 pass that:

(insn 9 8 10 2 (parallel [
(set (reg:DI 60 [ b ])
(zero_extend:DI (mem/c/i:SI (symbol_ref:SI (b) var_decl
0xb7caf108 b) [3 b+0 S4 A32])))
(clobber (reg:CC 17 flags))
]) 79 {zero_extendsidi2_32} (nil)
(nil))

...

(insn 11 10 12 2 (parallel [
(set (reg:SI 61)
(mult:SI (reg:SI 62 [ a ])
(subreg:SI (reg:DI 60 [ b ]) 4)))
(clobber (reg:CC 17 flags))
]) 182 {*mulsi3_1} (nil)
(nil))

can simply be substituted with:

(insn 11 9 12 2 (set (reg:SI 61)
(const_int 0 [0x0])) 34 {*movsi_1} (nil)
(nil))


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35281



[Bug rtl-optimization/35281] [4.3/4.4 Regression] multiply with 0 generated for 64*32-64

2008-03-05 Thread ubizjak at gmail dot com


--- Comment #7 from ubizjak at gmail dot com  2008-03-05 11:10 ---
It looks that:

2006-11-03  Paolo Bonzini  [EMAIL PROTECTED]
Steven Bosscher  [EMAIL PROTECTED]

* fwprop.c: New file.
...
* cse.c (fold_rtx_subreg, fold_rtx_mem, fold_rtx_mem_1, find_best_addr,
canon_for_address, table_size): Remove.
(new_basic_block, insert, remove_from_table): Remove references to
table_size.
(fold_rtx): Process SUBREGs and MEMs with equiv_constant, make
simplification loop more straightforward by not calling fold_rtx
recursively.
(equiv_constant): Move here a small part of fold_rtx_subreg,
do not call fold_rtx.  Call avoid_constant_pool_reference
to process MEMs.

removed this functionality. Specifically this part:

-/* If this is a constant pool reference, we can fold it into its
-   constant to allow better value tracking.  */
-if (base  GET_CODE (base) == SYMBOL_REF
-CONSTANT_POOL_ADDRESS_P (base))
-  {
-   rtx constant = get_pool_constant (base);
-   enum machine_mode const_mode = get_pool_mode (base);
-   rtx new;
-
-   if (CONSTANT_P (constant)  GET_CODE (constant) != CONST_INT)
- {
-   constant_pool_entries_cost = COST (constant);
-   constant_pool_entries_regcost = approx_reg_cost (constant);
- }
-
-   /* If we are loading the full constant, we have an
-  equivalence.  */
-   if (offset == 0  mode == const_mode)
- return constant;
-
-   /* If this actually isn't a constant (weird!), we can't do
-  anything.  Otherwise, handle the two most common cases:
-  extracting a word from a multi-word constant, and
-  extracting the low-order bits.  Other cases don't seem
-  common enough to worry about.  */
-   if (! CONSTANT_P (constant))
- return x;
-
-   if (GET_MODE_CLASS (mode) == MODE_INT
-GET_MODE_SIZE (mode) == UNITS_PER_WORD
-offset % UNITS_PER_WORD == 0
-(new = operand_subword (constant,
-  offset / UNITS_PER_WORD,
-  0, const_mode)) != 0)
- return new;
-
-   if (((BYTES_BIG_ENDIAN
-  offset == GET_MODE_SIZE (GET_MODE (constant)) - 1)
-|| (! BYTES_BIG_ENDIAN  offset == 0))
-(new = gen_lowpart (mode, constant)) != 0)
- return new;
-  }

This also explains why 4.2 doesn't fold HImode references (Other cases don't
seem common enough to worry about.).

Can we have this functionality back, perhaps also for Other cases, since
there are people that worry about them?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35281



[Bug rtl-optimization/35281] [4.3/4.4 Regression] multiply with 0 generated for 64*32-64

2008-03-05 Thread bonzini at gnu dot org


--- Comment #8 from bonzini at gnu dot org  2008-03-05 13:21 ---
Should be handled by this code in simplify_subreg:

  /* A SUBREG resulting from a zero extension may fold to zero if
 it extracts higher bits that the ZERO_EXTEND's source bits.  */
  if (GET_CODE (op) == ZERO_EXTEND
   bitpos = GET_MODE_BITSIZE (GET_MODE (XEXP (op, 0
return CONST0_RTX (outermode);

fwprop does not because the memory is written to.  Can anyone run spec moving
fwprop *before* CSE instead of after?


-- 

bonzini at gnu dot org changed:

   What|Removed |Added

  BugsThisDependsOn||13724


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35281



[Bug rtl-optimization/35281] [4.3/4.4 Regression] multiply with 0 generated for 64*32-64

2008-03-05 Thread bonzini at gnu dot org


--- Comment #9 from bonzini at gnu dot org  2008-03-05 13:22 ---
 fwprop does not because the memory is written to

(and fwprop does not do alias analysis).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35281