Skip to content

copy-propagation pass inflates the source #283

Description

@Endilll

As the title says, a bug in copy-propagation seem to have a bug that inflates the source. It prevents creduce from making further progress. Here's the log:

===< pass_clang :: copy-propagation >===
(85.1 %, 90824 bytes)
timestamp 8292 size 90824
(85.1 %, 90826 bytes)
timestamp 8293 size 90826
(85.1 %, 90798 bytes)
timestamp 8293 size 90798
(85.1 %, 90784 bytes)
timestamp 8294 size 90784
(85.1 %, 90784 bytes)
timestamp 8295 size 90784
(85.1 %, 90813 bytes)
timestamp 8304 size 90813
(85.1 %, 90871 bytes)
timestamp 8305 size 90871
(85.0 %, 90987 bytes)
timestamp 8306 size 90987
(85.0 %, 91219 bytes)
timestamp 8306 size 91219
(84.9 %, 91683 bytes)
timestamp 8307 size 91683
(84.8 %, 92611 bytes)
timestamp 8307 size 92611
(84.5 %, 94467 bytes)
timestamp 8308 size 94467
(83.9 %, 98179 bytes)
timestamp 8308 size 98179
(82.6 %, 105603 bytes)
timestamp 8309 size 105603
(80.2 %, 120451 bytes)
timestamp 8309 size 120451
(75.3 %, 150147 bytes)
timestamp 8310 size 150147
(65.6 %, 209539 bytes)
timestamp 8311 size 209539
(46.0 %, 328323 bytes)
timestamp 8311 size 328323
(7.0 %, 565891 bytes)
timestamp 8312 size 565891
(-71.1 %, 1041027 bytes)
timestamp 8313 size 1041027
(-227.3 %, 1991299 bytes)
timestamp 8315 size 1991299
(-539.7 %, 3891843 bytes)
timestamp 8318 size 3891843
(-1164.5 %, 7692931 bytes)
timestamp 8325 size 7692931
(-2414.0 %, 15295107 bytes)
timestamp 8344 size 15295107
(Interestingness test killed by timeout at 20 seconds.)
===< pass_clang :: callexpr-to-value >===

This piece of the original source:

inline constexpr auto with_sym = []<typename tag>(type_t<tag>,auto &&f,id id){
  static_assert(concepts::symtag<tag>);
  return with_enum<tag>(
    [=,f = static_cast<decltype(f) &&>(f)](auto t)mutable{
      return f(sym<t()>{idx_of(id)});
    },
    tag_of(type_c<tag>,id));
};

got inflated like this:

inline constexpr auto with_sym = []< typename tag >(type_t< tag >, auto &&f,
                                                    id id) {
  return with_enum(
      [=, f = static_cast< decltype(f) && >(f)](auto t) mutable {
        return static_cast<decltype(static_cast<decltype(static_cast<decltype(static_cast<decltype(static_cast<decltype(static_cast<decltype(static_cast<decltype(static_cast<decltype(static_cast<decltype(static_cast<decltype(static_cast<decltype(static_cast<decltype(static_cast<decltype(static_cast<decltype(static_cast<decltype(static_cast<decltype(static_cast<decltype(static_cast<decltype(static_cast<decltype(f) &&>(f)) &&>(static_cast<decltype(f) &&>(f))) &&>(static_cast<decltype <...>
(static_cast<decltype(f) &&>(f)) &&>(static_cast<decltype(f) &&>(f))) &&>(static_cast<decltype(static_cast<decltype(f) &&>(f)) &&>(static_cast<decltype(f) &&>(f)))))))))))))))))))(sym<t()>{
 }
      );
      },
      tag_of(type_c< tag >, id));
};

I attached the full source after inflation in case it's helpful.
C-Reduce invocation:
creduce --no-cache --n 8 --timeout 20 --timing --remove-pass pass_clang rename-fun --remove-pass pass_clang rename-param --remove-pass pass_clang rename-var --remove-pass pass_clang rename-class --remove-pass pass_clang rename-cxx-method --remove-pass pass_clex rename-toks --sllooww test.sh pp.ii
C-Reduce --version string is creduce 2.11.0 (unknown). It comes from a Debian unstable repo. Package version is 2.11.0~20240909-2.
gh124471.zip

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions