This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/20396] TRULY_NOOP_TRUNCATION ignored


------- Additional Comments From amylaar at gcc dot gnu dot org  2005-04-08 17:04 -------
(In reply to comment #1)
:2005-03-09  J"orn Rennecke <joern.rennecke@st.com>
:            Richard Shann <rshann@superh.com>
:
:        * emit-rtl.c (gen_lowpart_common): Handle TRUNCATE.  Generate
:        TRUNCATE for non-noop truncations.
:        * expr.c (force_operand): Handle TRUNCATE.
:        * rtlanal.c (reg_overlap_mentioned_p): Likewise.
:        * loop.c (combine_movables): Take TRULY_NOOP_TRUNCATION into account.
:        * optabs.c (expand_binop): Likewise.
:        * expmed.c (extract_fixed_bit_field): Check before assuming that
:        op is a MEM.

Note that this a rather radical approach, in that it changes the behaviour
of gen_lowpart_common to generate TRUNCATE instead of an unsuitable
no-op truncation.  This is efficient to safeguard against wrong code from the
numerous places that call gen_lowpart, but the downside is that then TRUNCATE
appears in interesting new places.  This requires handling both in
machine-independent code and in every port that doesn't set
TRULY_NOOP_TRUNCATION to be always true.  As far as I can see, this affects
exactly two ports: SH64 and mips.  I will pursue this patch further if the
mips maintainers agree that this is a sensible approach to pursue, but not
otherwise.

In the meantime, I'll post a patch to gcc-patches that follows the more
'traditional' approach of fixing the callers of gen_lowpart, where these
problems have been detected.  This has very little risk of breaking an existing
port, but a high probability to be incomplete.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rsandifo at redhat dot com,
                   |                            |echristo at redhat dot com


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]