Mercurial > hg > index.cgi
view docs/manual/index.html @ 418:3832a68d83ef
Fix internal compiler error on "var2 = var1 + 1" patterns
This appears to be the correct fix. It was provided by Tormod Volden
(debian.tormod@gmail.com). The final commit is substantially different from
Tormod's submission mostly due to housecleaning (removing the old patches
and updating the README). Tormod's comments follow.
The original addhi_mem_1 "insn" instruction pattern /matches/ two
memory operands, just with the /constraint/ that these are the same
location. A pattern match tells the compiler "you should be able to use
this, but you might have to work on it to meet the constraints". For
typical constraints on registers the compiler can add "reloads", moving
stuff between registers or from memory, until the constraints are met
and the instruction can be used. However, in this case, no amount of
reloads can make two memory locations the same if they already weren't,
so the compiler breaks down and cries "unable to generate reloads".
It seems this issue only appears if optimization is enabled. The proof
is in gcc's reload.c and is left as an exercise to the reader.
Limiting the matching pattern to identical memory operands avoids
these situations, while allowing the common "var++" cases.
References:
The pattern/constraints difference is explained in
https://gcc.gnu.org/onlinedocs/gccint/Simple-Constraints.html#index-other-register-constraints-3335
author | William Astle <lost@l-w.ca> |
---|---|
date | Tue, 29 Mar 2016 21:21:49 -0600 |
parents | fc166b3bbae3 |
children | cad5937314cb |
line wrap: on
line source
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >LW Tool Chain</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="NEXT" TITLE="Introduction" HREF="c13.html"></HEAD ><BODY CLASS="BOOK" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="BOOK" ><A NAME="AEN1" ></A ><DIV CLASS="TITLEPAGE" ><H1 CLASS="TITLE" ><A NAME="AEN2" >LW Tool Chain</A ></H1 ><H3 CLASS="AUTHOR" ><A NAME="AEN4" ></A >William Astle</H3 ><H3 CLASS="AUTHOR" ><A NAME="AEN7" ></A >LWTools Contributors </H3 ><P CLASS="COPYRIGHT" >Copyright © 2009-2015 William Astle and LWTools contributors</P ><HR></DIV ><DIV CLASS="TOC" ><DL ><DT ><B >Table of Contents</B ></DT ><DT >1. <A HREF="c13.html" >Introduction</A ></DT ><DD ><DL ><DT >1.1. <A HREF="c13.html#AEN16" >History</A ></DT ></DL ></DD ><DT >2. <A HREF="c21.html" >Output Formats</A ></DT ><DD ><DL ><DT >2.1. <A HREF="c21.html#AEN24" >Raw Binaries</A ></DT ><DT >2.2. <A HREF="x27.html" >DECB Binaries</A ></DT ><DT >2.3. <A HREF="x32.html" >ASCII Hexadecimal</A ></DT ><DT >2.4. <A HREF="x36.html" >Motorola S-Record</A ></DT ><DT >2.5. <A HREF="x41.html" >Intel Hex</A ></DT ><DT >2.6. <A HREF="x46.html" >OS9 Modules</A ></DT ><DT >2.7. <A HREF="x54.html" >Object Files</A ></DT ></DL ></DD ><DT >3. <A HREF="c62.html" >LWASM</A ></DT ><DD ><DL ><DT >3.1. <A HREF="c62.html#AEN65" >Command Line Options</A ></DT ><DT >3.2. <A HREF="x218.html" >Dialects</A ></DT ><DT >3.3. <A HREF="x227.html" >Source Format</A ></DT ><DT >3.4. <A HREF="x237.html" >Symbols</A ></DT ><DT >3.5. <A HREF="x242.html" >Numbers and Expressions</A ></DT ><DT >3.6. <A HREF="x250.html" >Assembler Directives</A ></DT ><DD ><DL ><DT >3.6.1. <A HREF="x250.html#AEN253" >Data Directives</A ></DT ><DT >3.6.2. <A HREF="x250.html#AEN364" >Address Definition</A ></DT ><DT >3.6.3. <A HREF="x250.html#AEN415" >Conditional Assembly</A ></DT ><DT >3.6.4. <A HREF="x250.html#AEN486" >OS9 Target Directives</A ></DT ><DT >3.6.5. <A HREF="x250.html#AEN511" >Miscelaneous Directives</A ></DT ></DL ></DD ><DT >3.7. <A HREF="x551.html" >Macros</A ></DT ><DT >3.8. <A HREF="x574.html" >Structures</A ></DT ><DT >3.9. <A HREF="x595.html" >Object Files and Sections</A ></DT ><DT >3.10. <A HREF="x659.html" >Assembler Modes and Pragmas</A ></DT ><DT >3.11. <A HREF="x795.html" >Convenience Instructions</A ></DT ><DT >3.12. <A HREF="x800.html" >Cycle Counts</A ></DT ></DL ></DD ><DT >4. <A HREF="c806.html" >LWLINK</A ></DT ><DD ><DL ><DT >4.1. <A HREF="c806.html#AEN809" >Command Line Options</A ></DT ><DT >4.2. <A HREF="x906.html" >Linker Operation</A ></DT ><DT >4.3. <A HREF="x920.html" >Linking Scripts</A ></DT ><DT >4.4. <A HREF="x986.html" >Format Specific Linking Notes</A ></DT ><DD ><DL ><DT >4.4.1. <A HREF="x986.html#AEN989" >OS9 Modules</A ></DT ></DL ></DD ></DL ></DD ><DT >5. <A HREF="c1001.html" >Libraries and LWAR</A ></DT ><DD ><DL ><DT >5.1. <A HREF="c1001.html#AEN1005" >Command Line Options</A ></DT ></DL ></DD ><DT >6. <A HREF="c1063.html" >Object Files</A ></DT ></DL ></DIV ><DIV CLASS="LOT" ><DL CLASS="LOT" ><DT ><B >List of Tables</B ></DT ><DT >6-1. <A HREF="c1063.html#AEN1088" >Object File Term Types</A ></DT ><DT >6-2. <A HREF="c1063.html#AEN1118" >Object File Operator Numbers</A ></DT ></DL ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" > </TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" > </TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="c13.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" > </TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" > </TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Introduction</TD ></TR ></TABLE ></DIV ></BODY ></HTML >