This is the mail archive of the gcc-patches@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]

Re: [trunk] patch to correct problems with scanning *EXTRACTS.


Ralf Wildenhues wrote:
Hello Kenneth,

apologies, I'm in nitpick mode today.

* Kenneth Zadeck wrote on Wed, Apr 23, 2008 at 07:13:20PM CEST:
--- df-scan.c (revision 134562)
+++ df-scan.c (working copy)

@@ -618,16 +618,16 @@ df_scan_blocks (void)
LOC within INSN of BB. This function is only used externally. If the REF_FLAGS field contain DF_REF_SIGN_EXTRACT or
- DF_REF_ZERO_EXTRACT. WIDTH, OFFSET and MODE are used to access the
- fields if they were constants. Otherwise they should be -1 if
- those flags were set. */
+ DF_REF_ZERO_EXTRACT, the WIDTH, and OFFSET are used to access the
+ fields if they were constants. Otherwise the WIDTH and OFFSET
+ should be -1 if those flags were set. */

This comment didn't make sense earlier, and doesn't now, to me. It may just be the punctuation, but reformulating seems like a good idea anyway.

@@ -2589,9 +2586,9 @@ df_refs_add_to_chains (struct df_collect
/* Allocate a ref and initialize its fields. If the REF_FLAGS field contain DF_REF_SIGN_EXTRACT or
- DF_REF_ZERO_EXTRACT. WIDTH, OFFSET and MODE are used to access the fields
- if they were constants. Otherwise they should be -1 if those flags
- were set. */
+ DF_REF_ZERO_EXTRACT. WIDTH and OFFSET are used to access the
+ fields if they were constants. Otherwise the WIDTH and OFFSET
+ should be -1 if those flags were set. */

Likewise.


static struct df_ref *
df_ref_create_structure (struct df_collection_rec *collection_rec,

@@ -2666,9 +2662,9 @@ df_ref_create_structure (struct df_colle
at address LOC within INSN of BB. If the REF_FLAGS field contain DF_REF_SIGN_EXTRACT or
- DF_REF_ZERO_EXTRACT. WIDTH, OFFSET and MODE are used to access the
- fields if they were constants. Otherwise they should be -1 if
- those flags were set. */
+ DF_REF_ZERO_EXTRACT. WIDTH and OFFSET are used to access the
+ fields if they were constants. Otherwise the WIDTH and OFFSET
+ fields should be -1 if those flags were set. */

Likewise. :-)


static void

@@ -2886,15 +2880,15 @@ df_defs_record (struct df_collection_rec
/* Process all the registers used in the rtx at address LOC. If the REF_FLAGS field contain DF_REF_SIGN_EXTRACT or
- DF_REF_ZERO_EXTRACT. WIDTH, OFFSET and MODE are used to access the
- fields if they were constants. Otherwise they should be -1 if
- those flags were set. */
+ DF_REF_ZERO_EXTRACT. WIDTH, and OFFSET are used to access the
+ fields if they were constants. Otherwise the WIDTH and OFFSET
+ should be -1 if those flags were set. */

Likewise.


static void
df_uses_record (struct df_collection_rec *collection_rec,
rtx *loc, enum df_ref_type ref_type,

@@ -4399,8 +4391,8 @@ df_exit_block_bitmap_verify (bool abort_
}
-/* Return true if df_ref information for all insns in all blocks are
- correct and complete. */
+/* Return true if the df_ref information for all insns in all blocks
+ are correct and complete. */

s/are/is/


--- df-byte-scan.c (revision 134562)
+++ df-byte-scan.c (working copy)

@@ -70,13 +69,24 @@ df_compute_accessed_bytes_extract (struc
int offset = DF_REF_EXTRACT_OFFSET (ref);
int width = DF_REF_EXTRACT_WIDTH (ref);
+ /* In this case, either the offset or the width was a non constant
+ value. */
if (width == -1 || offset == -1)
- return true;
-
- m1 = DF_REF_EXTRACT_MODE (ref);
- m1_size = GET_MODE_SIZE (m1);
+ {
+ if (mm == DF_MM_MUST)
+ {
+ *start_byte = 0;
+ *last_byte = 0;
+ return false;
+ }
+ else
+ return true;
+ }
- gcc_assert (m1_size <= UNITS_PER_WORD);
+ /* In order to accomodate multiword subregs of a hardreg, df_scan

s/accomodate/accommodate/


+ eats the subreg and it can only be found from the loc. */
+ if (REG_P (reg))
+ reg = *(DF_REF_LOC (ref));
/* There is nothing to do if this is a pure big or small endian
machine, but if the machine is a pastiche, we have to convert the

Cheers,
Ralf

I will fix all of this before commit. Could you please give the patch a spin also?


thanks for the comments.

kenny


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