1.61 -Rpass

Outputs remarks from the optimization passes made by armclang. You can output remarks for all optimizations, or remarks for a specific optimization.

Note:

This topic describes a [COMMUNITY] feature. See Support level definitions.

Syntax

-Rpass={*|optimization}

Parameters

Where:

*
Indicates that remarks for all optimizations that are performed are to be output.
optimization
Is a specific optimization for which remarks are to be output. See the Clang Compiler User’s Manual for more information about the optimization values you can specify.

Example

The following examples use the file:

// test.c

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void *__stack_chk_guard = (void *)0xdeadbeef;

void __stack_chk_fail(void) {
  printf("Stack smashing detected.\n");
  exit(1);
}

static void copy(const char *p) {
  char buf[8];
  strcpy(buf, p);
  printf("Copied: %s\n", buf);
}

int main(void) {
  const char *t = "Hello World!";
  copy(t);
  printf("%s\n", t);
  return 0;
}
  • To display the inlining remarks, specify:

    armclang -c --target=arm-arm-none-eabi -march=armv8-a -O2 -Rpass=inline test.c
    test.c:22:3: remark: copy inlined into main with (cost=-14980, threshold=337) [-Rpass=inline]
      copy(t);
      ^
  • To display the stack protection remarks, specify:

    armclang -c --target=arm-arm-none-eabi -march=armv8-a -fstack-protector -O0 -Rpass=stack-protector test.c
    test.c:14:13: remark: Stack protection applied to function copy due to a stack allocated buffer or struct containing a
          buffer [-Rpass=stack-protector]
    static void copy(const char *p) {
                ^
Non-ConfidentialPDF file icon PDF versionDUI0774J
Copyright © 2014–2017, 2019 Arm Limited or its affiliates. All rights reserved.